|
-
Mar 12th, 2000, 09:58 PM
#1
Thread Starter
New Member
I swear blind I cannot find how to do this from the MSDN.
>Okay, I've managed to create a table as per Clunietp:
Dim strConnectionStringOfNewDB As String
Dim objCat As ADOX.Catalog
Set objCat = New ADOX.Catalog
strConnectionStringOfNewDB = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=C:\db.mdb"
objCat.Create strConnectionStringOfNewDB
Set objCat = Nothing
>Now I try to create a table:
cCN.Provider = "Microsoft.Jet.OLEDB.3.51;"
cCN.Properties("Data Source") = "c:\db.mdb"
cCN.Open
Set cRS = cCN.Execute("CREATE TABLE tblint (anumber TEXT atype TEXT);")
>but it falls over on the SQL!
What am I doing wrong? Perhaps I should have started this app in DAO, but I've come so far I can't let ADO beat me now!
Thanks
CYOCONNOR
-
Mar 12th, 2000, 11:40 PM
#2
Guru
why don't you use the code Chris posted here: http://www.vb-world.net/forums/showt...0&pagenumber=2 ??
Anyways, using your method, where are your connection and recordset objects defined? Why are you trying to return a recordset from a CREATE TABLE statement?
To get your way to work, change this line:
CREATE TABLE tblint (anumber TEXT atype TEXT)
To this:
CREATE TABLE tblint (anumber TEXT, atype TEXT)
You forgot the comma.
HTH
Tom
-
Mar 13th, 2000, 07:56 AM
#3
Thread Starter
New Member
Thanks for the help, yet again, Clunietp.
<b>
why don't you use the code Chris posted here: http://www.vb-world.net/forums/showthread.php?threadid=10720&pagenumber=2 ??
</B>
Because the subject header related to setting database passwords, not creating tables, as did the first few posts, which meant I just skipped over it when searching.
I searched the whole forum for answers to this question. Mustn't be searching hard enough!
CYOCONNOR
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
|