-
bad syntax? SOLVED
hello
i am tryig to get my vb form to creata new table in an existing db
i am using the following code
Option Explicit
Private Sub cmdCreateTable_Click()
Dim conScores As ADODB.Connection
Dim strSQL As String
Set conScores = New ADODB.Connection
conScores.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source='C:\temp\db3.mdb'"
strSQL = "CREATE TABLE scores (" & _
"Option1 bit," & "option2 bit," & "opt3 bit," & "opt4 bit," & "opt5 bit," & _
"opt6 bit," & "opt7 bit," & "opt8 bit," & _
"opt9 bit" & "opt10 bit," & "opt11 bit," & _
"opt12 bit," & "opt13 bit," & "opt14 bit," & _
"opt15 bit," & "opt16 bit," & "opt17 bit," & _
"opt618 bit," & "opt19 bit," & "opt20 bit," & _
"opt21 bit," & "opt22 bit," & "opt23 bit," & _
"opt24 bit," & "opt25 bit," & "opt26 bit," & _
"opt27 bit," & "opt28 bit," & "opt29 bit," & _
"opt30 bit," & "opt31 bit," & "opt32 bit," & _
"opt33 bit," & "opt34 bit);"
conScores.Execute strSQL ' i get the error here
MsgBox "A table named Scores has been added to the db3.mdb database"
Set conScores = Nothing
End Sub
i get "sytax error in field defintion"
what have i missed
Mac
Last edited by MacataQ; 07-26-2005 at 01:15 PM.
Reason: SOLVED
-
You're missing a comma:
"opt9 bit," & "opt10 bit," & "opt11 bit," & _
Paul
~~~~
Microsoft MVP (Visual Basic)
-
omg , what a dope i am
cant see whats in front of me..lol
thanks Paul
-
jeez Paul, you DO have a good eye!
In cases like this, I prefer to create my command string in a loop, because I know that I will miss something... besides my eyesight
Marco
"There are two ways to write error-free programs. Only the third one works."
Unknown
-
Yeah, I only spent about five minutes looking at the statement before I finally noticed the missing comma. ;-)
Paul
~~~~
Microsoft MVP (Visual Basic)
Similar Threads
-
By Mitch in forum VB Classic
Replies: 1
Last Post: 11-11-2002, 04:06 PM
-
By Patrick Troughton in forum .NET
Replies: 78
Last Post: 08-13-2002, 11:18 AM
-
By Dan Barclay in forum .NET
Replies: 16
Last Post: 08-12-2002, 10:06 PM
-
Replies: 90
Last Post: 04-17-2001, 12:45 AM
-
By Rod Falanga in forum ASP.NET
Replies: 1
Last Post: 03-16-2000, 10:10 AM
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
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|