|
-
May 30th, 2000, 02:53 AM
#1
Thread Starter
Addicted Member
Hi everyone,
I have a database that has 3 Tables, none of them are linked together.[/b]
This is the Structure of the Database
Table1
Table1_Field1
Table1_Field2
Table1_Field3
USER_NAME
Table2
Table2_Field1
Table2_Field2
Table2_Field3
USER_NAME
Table3
Table3_Field1
Table3_Field2
Table3_Field3
USER_NAME
If you notice, USER_NAME is common in the 3 tables. Now here is the question. What is the easiest way to change the value for USER_NAME from Tom to Harry, in all the 3 tables?
P.S. I'm using ADO
-
May 30th, 2000, 03:31 AM
#2
Hyperactive Member
look at the "UPDATE" SQL command
-
May 30th, 2000, 05:51 AM
#3
Sub Test()
Dim cm As New ADODB.Command, i as Integer
With cm
.CommandType = adCmdText
.ActiveConnection = GetConn() ' Get a connection here
For i = 1 To 3
.CommandText = "Update Table" & i & " Set USER_NAME = 'Harry' Where USER_NAME = 'Tom'"
.Execute
Next
End With
Set cm = Nothing
End Sub
-
May 30th, 2000, 09:38 AM
#4
Hyperactive Member
May be a bit off topic.
I am new to ADO, and very confused with the connections when going through the manuals.
Could anybody give me some example for the following:
1) Connect to local (LAN) SQL Server
2) Connect to remote (Through TCP/IP) SQL Server
Assume that the TCP/IP is 210.67.167.110
the DB Name is Test
User id is 'chong'
Password is 'kitty'
Sory for off topic since I am desparate in the connection string.
-
May 30th, 2000, 10:28 AM
#5
Hyperactive Member
I wrote a nice ADO wrapper class which makes ADO much easier.. I can post it later if you want. It allows for all types of connections. SQL, text, DSN, XLS, FOXPRO, etc...
-
May 30th, 2000, 10:54 AM
#6
Hyperactive Member
Shickadance,
Please post it ASAP
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
|