|
-
Jan 27th, 2009, 08:45 AM
#1
Thread Starter
New Member
Newbie to VB
Hi all,
New to VB and just trying to create a table in a DB the script runs and doesnt error but table isnt created?? any ideas much appreciated
Dim objConnection, username, password, servername, databasename
servername = "Server"
databasename = "DB"
username = "user"
password = "password"
sub CreateDatabase
objConnection.Create _
"Provider=SQLOLEDB;Data Source=" & servername & ";" & _
"Trusted_Connection=Yes;Initial Catalog=" & databasename & ";" & _
"User ID=" & username & ";Password=" & password & ";"
objConnection.Execute "CREATE TABLE test table(" & _
"Year TEXT(4), " & _
"Month TEXT(9), " & _
"Day TEXT(2), " & _
"Time TEXT(25))"
End Sub
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
|