Can some one please explane why this insert not working i am geting an error.Run-time error (-2147217900(80040e14)
Syntax error in insert into statement.
Private Sub cmdtest_Click()
Dim test As String
Dim oConn As New ADODB.Connection
Dim strSQL As String
Dim rsdb As New ADODB.Recordset
Dim xreg, xtitle, xfirst, xmiddle, xlast, xstreet, xcity, xzip, xcountry, xstate As String
xreg = txtReg.Text
Set oConn = CreateObject("ADODB.Connection")
Set rsdb = CreateObject("ADODB.RecordSet")
'Set rsd = CreateObject("Database")
oConn.Mode = adModeShareExclusive
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\holyfamily\data\holyfamily.mdb;"
test = txtbilly.Text
oConn.Execute "INSERT INTO personalinfo (Registration)VALUES("'&xreg&'")
Syntax error in insert into statement.
Private Sub cmdtest_Click()
Dim test As String
Dim oConn As New ADODB.Connection
Dim strSQL As String
Dim rsdb As New ADODB.Recordset
Dim xreg, xtitle, xfirst, xmiddle, xlast, xstreet, xcity, xzip, xcountry, xstate As String
xreg = txtReg.Text
Set oConn = CreateObject("ADODB.Connection")
Set rsdb = CreateObject("ADODB.RecordSet")
'Set rsd = CreateObject("Database")
oConn.Mode = adModeShareExclusive
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\holyfamily\data\holyfamily.mdb;"
test = txtbilly.Text
oConn.Execute "INSERT INTO personalinfo (Registration)VALUES("'&xreg&'")