Create Access table with vb/net then insert

  • Thread starter Thread starter adebiasio
  • Start date Start date
A

adebiasio

I have a procedure that uses ADOX to create a database with a table.
That works fine. I then need to populate that table with a record but
the code is not working. I believe that the database is still locked.

Dim lcat as New ADOX.Catalog
Dim ltbl As New ADOX.Table

lcat.Create(connection)

' Code to create table.

ltbl = Nothing
lcat = Nothing

In the same procedure, I create a connection to execute a INSERT
command, but an error is generated on the lcnn.open()

Dim lcnn As Data.OleDb.OleDbConnection

lcnn = New Data.OleDb.OleDbConnection(lstrConnection)
lcnn.Open()

Thanks!
 
On 5 Dec 2005 13:52:35 -0800, (e-mail address removed) wrote:

¤ I have a procedure that uses ADOX to create a database with a table.
¤ That works fine. I then need to populate that table with a record but
¤ the code is not working. I believe that the database is still locked.
¤
¤ Dim lcat as New ADOX.Catalog
¤ Dim ltbl As New ADOX.Table
¤
¤ lcat.Create(connection)
¤
¤ ' Code to create table.
¤
¤ ltbl = Nothing
¤ lcat = Nothing
¤
¤ In the same procedure, I create a connection to execute a INSERT
¤ command, but an error is generated on the lcnn.open()
¤
¤ Dim lcnn As Data.OleDb.OleDbConnection
¤
¤ lcnn = New Data.OleDb.OleDbConnection(lstrConnection)
¤ lcnn.Open()


You might want to post your code and identify the error and where it is occurring.


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Thanks for your help. Sometimes the simplist error is ignored. I had
a syntax error in the INSERT.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top