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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting into Access table 1

Status
Not open for further replies.

boatdrinks

IS-IT--Management
Jun 18, 2004
51
US
I have this code that runs, but nothing shows up in the access table. What am I doing wrong?

Dim connectionString As String =("Provider=Microsoft.Jet.OLEDB.4.0; data source=" & server.mappath("SupportRequests.mdb"))

Dim oleConnection As New OleDBConnection(connectionString)
oleConnection.Open()

Dim oleCommand = New OleDbCommand("INSERT INTO requests(firstname,lastname,importance,problem,software,hardware) Values('" & Insertfirstname.text & "','" & Insertlastname.text & "','" & Insertimportance.selecteditem.text & "','" & Insertproblem.text & "','" & Insertsoftware.selecteditem.text & "','" & Inserthardware.selecteditem.text & "')")

oleCommand.Connection = oleConnection
oleConnection.Close()
 
before oleConnection.Close add oleCommand.ExecuteNonQuery()

--------------------------
"two wrongs don't make a right, but three lefts do" - the unknown sage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top