-
Hi guys
I have the following code that connects to an access database.
Code:
Dim AccessConnect As String
AccessConnect = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=Hello.mdb;" & _
"DefaultDir=" & App.Path & ";" & _
"UID=admin;PWD=;"
Dim Conn1 As ADODB.Connection
Dim Cmd1 As ADODB.Command
Dim Params1 As ADODB.Parameters
Dim Param1 As ADODB.Parameter
Dim Rs1 As ADODB.Recordset
Dim i As Integer
Set Conn1 = New ADODB.Connection
Conn1.ConnectionString = AccessConnect
Conn1.Open
I also have 3 variables that are called CUST1 CUST2 and CUST3. I am trying to figure out how to send these variables to a table called Table1 in the first 3 fields called CUST1 CUST2 and CUST3. Thanks a million for any help that anyone may be able to offer.
Cheers
JK
[Edited by kanejone on 11-29-2000 at 05:09 AM]
-
conn1.execute "UPDATE Table1 SET Cust1 = '" & Cust1 & "', cust2 = '" & cust2 & "', cust3 = '" & cust3 & "';"
-
Cheers
Thanks a million for the help. I really appreciate it.
JK
-
Note that an unrestricted update SQL statement will update ALL rows in the table with the same value. So, be careful.
P.
-
Is there a way around this ????
-
oops, sorrry about that!
yes, just add a WHERE clause to the end the query
eg WHERE ColName <10
bit of an oversight on my part there...