hello,
I have a problem to a database (Access) and I reference its fields
before in Vb 6, I am do this with:
Dim RS As Recordset
Nombre_BD = "SERVICIOS. MDB"
Set ConexionBD = OpenDatabase(Ap p.Path & "\" & Nombre_BD)
Set RS = ConexionBD.Open Recordset("Sele ct * from tabla")
RS.Fields("comp anyiaParte")
In visual basic .net, what am I do??
Thanks
nahald 6 1001
Hi Nahald,
Something as this
\\\
Dim Conn As New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;" & "Data
Source=C:\SERVI CIOS.MDB;" )
Try
Dim cmd As New OleDbCommand("S elect * from tabla", Conn)
da = New OleDbDataAdapte r(cmd)
da.Fill(ds, "tabla")
Catch oledbExc As OleDbException
MessageBox.Show (oledbExc.ToStr ing)
Catch ex As Exception
MessageBox.Show (ex.Message)
Finally
Conn.Close()
End Try
The item from the first row is
dim a as string = ds.tables("tabl a").rows(0).ite m("companyiaPar te").tostring
///
I hope this was what you where looking for?
Cor hello, I have a problem to a database (Access) and I reference its fields before in Vb 6, I am do this with:
Dim RS As Recordset Nombre_BD = "SERVICIOS. MDB" Set ConexionBD = OpenDatabase(Ap p.Path & "\" & Nombre_BD) Set RS = ConexionBD.Open Recordset("Sele ct * from tabla") RS.Fields("comp anyiaParte")
In visual basic .net, what am I do??
Sorry, but You don´t defined ds than a variable, What is "ds"?
"Cor" <no*@non.com> escribió en el mensaje
news:OK******** ******@tk2msftn gp13.phx.gbl... Hi Nahald,
Something as this \\\ Dim Conn As New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;" &
"Data Source=C:\SERVI CIOS.MDB;" ) Try Dim cmd As New OleDbCommand("S elect * from tabla", Conn) da = New OleDbDataAdapte r(cmd) da.Fill(ds, "tabla") Catch oledbExc As OleDbException MessageBox.Show (oledbExc.ToStr ing) Catch ex As Exception MessageBox.Show (ex.Message) Finally Conn.Close() End Try The item from the first row is dim a as string =
ds.tables("tabl a").rows(0).ite m("companyiaPar te").tostring ///
I hope this was what you where looking for?
Cor
hello, I have a problem to a database (Access) and I reference its fields before in Vb 6, I am do this with:
Dim RS As Recordset Nombre_BD = "SERVICIOS. MDB" Set ConexionBD = OpenDatabase(Ap p.Path & "\" & Nombre_BD) Set RS = ConexionBD.Open Recordset("Sele ct * from tabla") RS.Fields("comp anyiaParte")
In visual basic .net, what am I do??
Hi Nahald,
Good you showed me I forgot that row
Now it is between the text
Sorry.
Cor Sorry, but You don´t defined ds than a variable, What is "ds"? Something as this \\\ Dim Conn As New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;" &
"Data Source=C:\SERVI CIOS.MDB;" ) Try Dim cmd As New OleDbCommand("S elect * from tabla", Conn)
dim ds as new Dataset
da = New OleDbDataAdapte r(cmd) da.Fill(ds, "tabla") Catch oledbExc As OleDbException MessageBox.Show (oledbExc.ToStr ing) Catch ex As Exception MessageBox.Show (ex.Message) Finally Conn.Close() End Try The item from the first row is dim a as string = ds.tables("tabl a").rows(0).ite m("companyiaPar te").tostring ///
I hope this was what you where looking for?
Cor
hello, I have a problem to a database (Access) and I reference its fields before in Vb 6, I am do this with:
Dim RS As Recordset Nombre_BD = "SERVICIOS. MDB" Set ConexionBD = OpenDatabase(Ap p.Path & "\" & Nombre_BD) Set RS = ConexionBD.Open Recordset("Sele ct * from tabla") RS.Fields("comp anyiaParte")
In visual basic .net, what am I do??
ok, thanks I think this line.
If I have to do a insert, update o delete in database, I will change this
line:
Dim cmd As New OleDbCommand("S elect * from tabla", Conn)
Is this true?
nahald
"Cor" <no*@non.com> escribió en el mensaje
news:Oz******** ******@TK2MSFTN GP12.phx.gbl... Hi Nahald,
Good you showed me I forgot that row
Now it is between the text
Sorry.
Cor Sorry, but You don´t defined ds than a variable, What is "ds"? Something as this \\\ Dim Conn As New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;" &
"Data Source=C:\SERVI CIOS.MDB;" ) Try Dim cmd As New OleDbCommand("S elect * from tabla", Conn) dim ds as new Dataset da = New OleDbDataAdapte r(cmd) da.Fill(ds, "tabla") Catch oledbExc As OleDbException MessageBox.Show (oledbExc.ToStr ing) Catch ex As Exception MessageBox.Show (ex.Message) Finally Conn.Close() End Try The item from the first row is dim a as string = ds.tables("tabl a").rows(0).ite m("companyiaPar te").tostring ///
I hope this was what you where looking for?
Cor
> hello, > I have a problem to a database (Access) and I reference its fields > before in Vb 6, I am do this with: > > Dim RS As Recordset > Nombre_BD = "SERVICIOS. MDB" > Set ConexionBD = OpenDatabase(Ap p.Path & "\" & Nombre_BD) > Set RS = ConexionBD.Open Recordset("Sele ct * from tabla") > RS.Fields("comp anyiaParte") > > In visual basic .net, what am I do?? >
Nahald,
Yes and than add them to the dataAdapter with
da.DeleteComman d = cmd (to do for the insertcommand, the deletecommand and
the updatecommand)
But for an update for a select as you are using it is more simple to add
after the da = New OleDbDataAdapte r(cmd)
Dim cb As New OleDbCommandBui lder(da)
(that makes and add the update, delete and insert for you, but they said it
is buggy with a lot of parameters).
When you have done that you can do to update
\\\
if ds.haschanges
da.update(ds.ge tchanges)
end if
///
Cor ok, thanks I think this line. If I have to do a insert, update o delete in database, I will change this line:
Dim cmd As New OleDbCommand("S elect * from tabla", Conn)
Is this true?
nahald > \\\ > Dim Conn As New OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;"
& "Data > Source=C:\SERVI CIOS.MDB;" ) > Try > Dim cmd As New OleDbCommand("S elect * from tabla", Conn)
dim ds as new Dataset
> > > > > da.Fill(ds, "tabla") > Catch oledbExc As OleDbException > MessageBox.Show (oledbExc.ToStr ing) > Catch ex As Exception > MessageBox.Show (ex.Message) > Finally > Conn.Close() > End Try > The item from the first row is > dim a as string = ds.tables("tabl a").rows(0).ite m("companyiaPar te").tostring > /// >
Thanks for all
I will test this.
nahald
"Cor" <no*@non.com> escribió en el mensaje
news:OR******** ******@TK2MSFTN GP11.phx.gbl... Nahald,
Yes and than add them to the dataAdapter with da.DeleteComman d = cmd (to do for the insertcommand, the deletecommand
and the updatecommand)
But for an update for a select as you are using it is more simple to add after the
da = New OleDbDataAdapte r(cmd) Dim cb As New OleDbCommandBui lder(da) (that makes and add the update, delete and insert for you, but they said
it is buggy with a lot of parameters).
When you have done that you can do to update \\\ if ds.haschanges da.update(ds.ge tchanges) end if ///
Cor
ok, thanks I think this line. If I have to do a insert, update o delete in database, I will change
this line:
Dim cmd As New OleDbCommand("S elect * from tabla", Conn)
Is this true?
nahald > \\\ > > Dim Conn As New
OleDbConnection ("Provider=Micr osoft.Jet.OLEDB .4.0;" & > "Data > > Source=C:\SERVI CIOS.MDB;" ) > > Try > > Dim cmd As New OleDbCommand("S elect * from tabla", Conn)
dim ds as new Dataset
> > > > > > da.Fill(ds, "tabla") > > Catch oledbExc As OleDbException > > MessageBox.Show (oledbExc.ToStr ing) > > Catch ex As Exception > > MessageBox.Show (ex.Message) > > Finally > > Conn.Close() > > End Try > > The item from the first row is > > dim a as string = > ds.tables("tabl a").rows(0).ite m("companyiaPar te").tostring > > /// > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Thys Brits |
last post by:
Hi,
I'm using the System.Web.Mail class to send an e-mail from my ASP.Net
application, but when sending the e-mail, I'm getting the above error. It
seems to be because I have Office XP installed, and the version of CDO is
replaced by this installation. I haven't been able to find this error
anywhere on any MS site. Anyone have a clue on how to then actually send the
e-mail?
Thanks
|
by: Jon Ole Hedne |
last post by:
My Access 2002-application need to work with tables from both Oracle and
Access. To solve this, I want to run some querys on three views in Oracle
and import the results into temporary Access-tables.
I have tried this:
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.ConnectionString = "data source=" & datafil & ";Jet OLEDB:Database
Password="
conn.Open datafil
|
by: CSDunn |
last post by:
Hello,
I have a situation with MS Access 2000 in which I need to display report
data in spreadsheet orientation (much like a datasheet view for a form). If
you think of the report in terms of what a spreadsheet might show, the
column names will actually be dynamic, based on data from a SQL Server 2000
database. The row data will also come from the same database. So in this
case, I will have a main report and a subreport. I've already tried...
|
by: doomx |
last post by:
I'm using SQL scripts to create and alter tables in my DB
I want to know if it's possible to fill the description(like in the
Create table UI) using these scripts.
EX:
CREATE TABLE(
Pk_myPrimaryKey INTEGER CONSTRAINT pk PRIMARY KEY DESCRIPTION 'This
is the primary key of the table',
|
by: Adam Turner via AccessMonster.com |
last post by:
If I had a field called "Name" in an Access table "Contact Info", and the
field contained VBScript...
Function Main(rstFields)
Main = rstFields.Item("FirstName").Value
End Function
1. How do I pass a recordset into this field?
2. How do I capture the return value?
| |
by: Art |
last post by:
Hi everyone
I was hoping someone might be able to help me with this. I'm just starting to try to work with MS Access tables through VB.net. In Access I can take an existing table and add a new field with the type AutoNumber. I can then set this up as a key. Then if I go into the table I will see sequential numbers have been inserted into that field for me. Can I do this through VB.net
I'd appreciate any help or alternative suggestions...
|
by: rick m |
last post by:
We have an access DB that 2 input people use to tracking incoming
patients. There is a form for them to do this but they find it
confusing to use (it's plainly laid out, no one else complains about
it). Management has decided that they want me to link 15 of our
templates so when a template is opened and text entered into one of the
text fields it will automatically be entered into the database.
First of all, is this possible?
...
|
by: pedz |
last post by:
I am trying to write a set of classes, probably template classes, to allow "pretty" and safe access to low level machine words.
The syntax I would like to end up with is something like:
foo = handle.vendor_id.get();
where handle would represent, in this case, the PCI config space, vendor_id is a particular offset into that space, and get is a method to retrieve the current value.
To add complexity, some registers are a set of bits or bit...
|
by: awayne |
last post by:
I am working with MS VB 6.5. I am putting together a MS Access (MS Access 2000) database for work to keep track of the projects and their status that we've done. I use MS Access to run a "Make-table query" that sorts by Ascending date (date is (Field(5) for coding purposes) and then use the information in the table to create the table in a word document. The query also captures beginning and ending dates so people can create a report that covers...
|
by: AlexNunley |
last post by:
I am trying to dump data from an access query into excel so I can pretify it. I found sample code from an old access 97 book (The version of access in use)and tinkered it into working.
Well sort of. The error I get is usually a "Object Required" error, and it highlights the bolded section below. I have been through this thing backwards and forth and cannot figure it out. I am new to this whole thing, so be easy on me.
Thanks!
Alex
...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |