jejernig
asked on
Help with Access and Visual Basic Insert statement
I am trying to insert data into a access database using textboxes and check boxes from a visual basic written form. Here is my query. I keep getting errors / not inserting at all into the database. Can someone help me. ps all the textbox names are correct.
Dim sqlInventoryString As String = "INSERT INTO Inventory (ID, First Name, Last Name, Description, Order Placed, Order Shipped, Order Received, Comments) values("",txtfirstname.tex t, txtlastname.text, txtdescription.text,checkb oxorderpla ced.checke d, checkboxordershipped.check ed, checkboxorderreceived.chec k, richtxtcomments.text);"
Dim sqlCommand As New OleDb.OleDbCommand(sqlInve ntoryStrin g, logInOleDbConnection)
' Open the database connection.
logInOleDbConnection.Open( )
' Run the sqlCommand.
Dim countFound As Integer = CType(sqlCommand.ExecuteSc alar, Integer)
' Close the database connection.
logInOleDbConnection.Close ()
' If countFound = 1 a record with a matching UserName and Password
' was found..
If countFound = 1 Then
Else
Label13.Text = "Error Found Please Retry"
Dim sqlInventoryString As String = "INSERT INTO Inventory (ID, First Name, Last Name, Description, Order Placed, Order Shipped, Order Received, Comments) values("",txtfirstname.tex
Dim sqlCommand As New OleDb.OleDbCommand(sqlInve
' Open the database connection.
logInOleDbConnection.Open(
' Run the sqlCommand.
Dim countFound As Integer = CType(sqlCommand.ExecuteSc
' Close the database connection.
logInOleDbConnection.Close
' If countFound = 1 a record with a matching UserName and Password
' was found..
If countFound = 1 Then
Else
Label13.Text = "Error Found Please Retry"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am getting a Syntax Error problem at this statement
Dim countFound As Integer = CType(sqlCommand.ExecuteSc
Why is that?