J
jmar
I'm hoping someone out there can give me a little guidance. I have
an Access Database "Customer.MDB" with a table "CustInfo" that
has the following design:
Field: DataType
CustID AutoNumber
Name Text
Title Text
Phone Text
'=========================================================
Dim conn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:\customer.mdb;")
Dim MyCommand As New OleDbCommand
Dim ra As Integer
Conn.open
cmndSTR = "Insert into CustInfo ([Name], [Title],[Phone]) VALUES
(NameTxt, TitleText, PhoneNum)
MyCommand = New OleDbCommand(cmndSTR, conn)
ra = MyCommand.ExecuteNonQuery()
'============================================================
My question is this: Once this code has been executed and a record has
been added, what is an easy way for me to load a variable (call it
"intCustID") with the CustID value (the AutoNumber field) of the
record that was just added?
A code snippet would be GREATLY appreciated...
Jmar
an Access Database "Customer.MDB" with a table "CustInfo" that
has the following design:
Field: DataType
CustID AutoNumber
Name Text
Title Text
Phone Text
'=========================================================
Dim conn As New
OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=c:\customer.mdb;")
Dim MyCommand As New OleDbCommand
Dim ra As Integer
Conn.open
cmndSTR = "Insert into CustInfo ([Name], [Title],[Phone]) VALUES
(NameTxt, TitleText, PhoneNum)
MyCommand = New OleDbCommand(cmndSTR, conn)
ra = MyCommand.ExecuteNonQuery()
'============================================================
My question is this: Once this code has been executed and a record has
been added, what is an easy way for me to load a variable (call it
"intCustID") with the CustID value (the AutoNumber field) of the
record that was just added?
A code snippet would be GREATLY appreciated...
Jmar