Run AccessAppend Query

  • Thread starter Thread starter Yahya
  • Start date Start date
¤ Dear Sires,
¤
¤ How can I run an append query in access from vb.net?
¤

Not sure if you're referring to a QueryDef or SQL statement. The following executes a QueryDef:

Dim AccessConn As System.Data.OleDb.OleDbConnection
Dim AccessCommand As System.Data.OleDb.OleDbCommand

AccessConn = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=e:\My Documents\db1.mdb")

AccessConn.Open()

AccessCommand = New System.Data.OleDb.OleDbCommand("QueryDefName", AccessConn)
AccessCommand.CommandType = CommandType.StoredProcedure
AccessCommand.Parameters.Add("@ParamName", System.Data.OleDb.OleDbType.VarWChar).Value =
"SomeValue"

AccessCommand.ExecuteNonQuery()

AccessConn.Close()


Paul
~~~~
Microsoft MVP (Visual Basic)
 

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