|
-
Nov 23rd, 2000, 06:07 AM
#1
Thread Starter
Addicted Member
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]
-
Nov 23rd, 2000, 07:24 AM
#2
Hyperactive Member
conn1.execute "UPDATE Table1 SET Cust1 = '" & Cust1 & "', cust2 = '" & cust2 & "', cust3 = '" & cust3 & "';"
-
Nov 23rd, 2000, 07:26 AM
#3
Thread Starter
Addicted Member
Cheers
Thanks a million for the help. I really appreciate it.
JK
-
Nov 23rd, 2000, 07:57 AM
#4
Fanatic Member
Note that an unrestricted update SQL statement will update ALL rows in the table with the same value. So, be careful.
P.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Nov 23rd, 2000, 08:10 AM
#5
Thread Starter
Addicted Member
Is there a way around this ????
-
Nov 23rd, 2000, 08:33 AM
#6
Hyperactive Member
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...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|