Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple query for Access

Status
Not open for further replies.

Malchik

Programmer
Dec 8, 2001
148
CA
I would like to fire some queries that will do either an INSERT or an UPDATE in an Access 2003 DB (not password protected). I am using some code that I found on the net (CreateOleDbCommand). I runs without any errors, but noting is changed in the DB. Here is that part of the code I wrote:

...
'SQL is constructed based on what the user selected
Call CreateOleDbCommand(sSQL, EmailSending.My.Settings.dbEmailConnectionString)

'I found this sub on the net
Private Sub CreateOleDbCommand(ByVal queryString As String, ByVal connectionString As String)
Using connection As New OleDb.OleDbConnection(connectionString)
connection.Open()
Dim command As New OleDb.OleDbCommand(queryString, connection)
command.CommandType = CommandType.Text
command.ExecuteNonQuery()
End Using
end Sub

Is anyone has a clue?

thanks!

Mal'chik [bigglasses]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top