|
-
November 16th, 1999, 05:07 PM
#1
ADO
Hi,
Adding fields to database, if I use the Stand-alone Recordsets, which
appends fields to the Fields collection, and finally open it:
rs.Fields.Append "FirstName" ,adChar,50
rs.Fields.Append "LastName" ,adChar,50
rs.Open
The problem is I do not know how to a associate the added Fields collection
to the "Employees" table I want to create.
I tried: rs.Open "Employees", cnn,adOpenStatic, adLockOptimistic
and get error ---->[Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'Employees'. Make sure it exists and that its name is spelled correctly.
Please show me the syntax
Thanks
-
November 18th, 1999, 05:46 PM
#2
Re: ADO
You can try using ADOX for which you need to set reference to msadox.dll
Just try the sample for reference.
Sub CreateTable()
Dim tbl As New Table
Dim cat As New ADOX.Catalog
'Open the catalog.
' Open the Catalog.
cat.ActiveConnection = _
"Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=dbname;"
tbl.Name = "MyTable"
tbl.Columns.Append "Column1", adInteger
tbl.Columns.Append "Column2", adInteger
tbl.Columns.Append "Column3", adVarWChar, 50
cat.Tables.Append tbl
End Sub
-
November 19th, 1999, 09:31 AM
#3
Re: ADO
Thanks for your code.
I really appreciate it.
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
|