S
Sparky Arbuckle
I'm trying to add customers to the database with the following
Add_Customer sub routine. The problem is that it is not writing the
information to the database. Any suggestions as to how I can fix this
problem? I made sure to check the spelling of all the textboxes and
database fields. This is frustrating.
Sub Add(sender As Object, e As System.EventArgs)
'insert new data
Dim strText as string
Dim myConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0;" &
_
"Data Source=DB.mdb"
Dim strSQL as string = "INSERT INTO tblCustomers " & _
"strEmail, strFName, strLName, strStreet, strCity, strState,
strZip VALUES " & _
"'" & tbEmail.text & "'," & _
"'" & tbFName.text & "'," & _
"'" & tbLName.text & "'," & _
"'" & tbStreet.text & "'," & _
"'" & tbCity.text & "'," & _
"'" & tbState.text & "'," & _
"'" & tbZip.text & "'"
ExecuteSQL(strSQL)
Response.redirect("default.aspx?add=success")
END Sub
Add_Customer sub routine. The problem is that it is not writing the
information to the database. Any suggestions as to how I can fix this
problem? I made sure to check the spelling of all the textboxes and
database fields. This is frustrating.
Sub Add(sender As Object, e As System.EventArgs)
'insert new data
Dim strText as string
Dim myConnection as String = "Provider=Microsoft.Jet.OLEDB.4.0;" &
_
"Data Source=DB.mdb"
Dim strSQL as string = "INSERT INTO tblCustomers " & _
"strEmail, strFName, strLName, strStreet, strCity, strState,
strZip VALUES " & _
"'" & tbEmail.text & "'," & _
"'" & tbFName.text & "'," & _
"'" & tbLName.text & "'," & _
"'" & tbStreet.text & "'," & _
"'" & tbCity.text & "'," & _
"'" & tbState.text & "'," & _
"'" & tbZip.text & "'"
ExecuteSQL(strSQL)
Response.redirect("default.aspx?add=success")
END Sub