Hi! I am currently creating a Registration form which contained: UserID
Password, FirstName and LastName.
These details would be inserted into Ms Access when I click submi
button. But I encounter with the problem to insert 'Password'. It work
fine if I did not insert 'Password' but if I did, it will shows that
have "syntax error: INSERT INTO..."
Did I miss something to write? Please kindly have a look on the cod
below, Thank you!
<%@ Import Namespace="Syst em.Data" %>
<%@ Imports Namespace="Syst em.Data.OleDb" %>
Private Sub btnSubmit_Click (ByVal sender As System.Object, ByVal e A
System.EventArg s) Handles btnSubmit.Click
Dim InsertCmd As New OleDbCommand
Dim SQLInsert As String
Dim DBConn As OleDbConnection
Dim Connstr As String
Connstr = "Provider=Micro soft.jet.oledb. 4.0;" & _
"DAT
SOURCE=C:\Inetp ub\wwwroot\samp les\Project\bin \Project-Library.mdb"
SQLInsert = "INSERT INTO User_Profile (UserID, Password, FirstName
LastName) VALUES ('" & txtUserID.Text & "', '" & txtRegPwd.Text & "'
'" & txtFirstName.Te xt & "', '" & txtLastName.Tex t & "')"
'Create connection
DBConn = New OleDbConnection (Connstr)
InsertCmd.Conne ction = DBConn
InsertCmd.Comma ndText = SQLInsert
Try
DBConn.Open()
InsertCmd.Execu teNonQuery()
Catch ex As Exception
Response.Write( ex.ToString())
Finally
DBConn.Close()
End Try
End Su
--
jinhy82Posted from
http://www.pcreview.co.uk/ newsgroup acces