prblm in recordset statement

Results 1 to 2 of 2

Thread: prblm in recordset statement

  1. #1
    Anuradha Guest

    Default prblm in recordset statement

    hi <BR>i m trying to connect a reg.. form to an access asp coding is as follows-:<BR>&#060;%@ Language=VBScript %&#062;<BR>&#060;!--#include virtual="/"--&#062;<BR>&#060;%<BR>Dim objConn<BR>Set objconn=Server.CreateObject("ADODB.Recordset")<BR> objConn.ConnectionString="DSN=reg.dsn"<BR>objConn. Open<BR>Dim objRS<BR>Set objRS=server.CreateObject("ADODB.Recordset")<BR>ob jRS.Open "registration",objConn, , adLockOptimistic,adCmdTable<BR>objRS.AddNew<BR>obj RS("First Name")=Request.Form("firstname")<BR>objRS("Last Name")=Request.Form("lastname")<BR>objRs("Gender") =Request.Form("gender")<BR>objRS("DOB")=DateSerial (Request.Form("year"),Request.Form("months"),Reque st.Form("date"))<BR>objRS("Address1")=Request.Form ("add1")<BR>objRS("Address2")=Request.Form("add2") <BR>objRS("City")=Request.Form("city")<BR>objRS("C ountry")=Request.Form("country")<BR>objRS("Email") =Request.Form("email")<BR>objRS("Username")=Reques t.Form("username")<BR>objRS("Password")=Request.Fo rm("psswd")<BR>objRS.Update <BR>Response.Write "Thank you"&""&objRS("First Name")&" "&objRS("Last Name")&" "& "for registering"<BR>%&#062;<BR><BR>But when i submit the form. msg shows an asp error shows<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR><BR>[Microsoft][ODBC Microsoft Access Driver] Syntax error in INSERT INTO statement. <BR><BR>/registration.asp, line 20 <BR> but i haven&#039t used any insert into statement. i have used recordset update. is it possible that dateserial that i m using is creating a prblm...<BR>Please help

  2. #2
    Join Date
    Dec 1969

    Default DEBUG DEBUG DEBUG...

    Under the covers, a driver is permitted to convert a RecordSet.AddNew "query" into a "SQL INSERT" statement, and many drivers do so.<BR><BR>Your DateSerial is not the problem in and of itself, but possibly you need to do <BR>objRS("DOB")="#" & DateSerial(Request.Form("year"),Request.Form("mont hs"),Request.Form("date")) & "#"<BR><BR>(Though I would not have thought so!)<BR><BR>But why not go *FIND* the problem field?<BR><BR>Use the most standard of program debugging tricks: The binary search.<BR><BR>Just eliminate half of the fields (comment them out...but never the primary key field). If the error is gone, then you know it is in one of the fields you commented out. If the error is still there, it is in one of the remaining fields. Just use process of elimination until you find the problem field.<BR><BR>Then, if you don&#039t understand the problem, post here again.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts