database access error

Results 1 to 2 of 2

Thread: database access error

  1. #1
    masud Guest

    Default database access error

    i use access 97 to insert name and email in<BR>a database . i used add.new and also add.update<BR>but it says provider error in Conn.open<BR>i think all the code is correct as well as DSN<BR>&#060;html><BR>&#060;body><BR>&#060;form method=post action="procform.asp"><BR>Name:&#060;input type=text name=text1 size=15><BR><BR>Email:&#060;input type=text name=text2 size=15><BR><BR>&#060;input type=submit value=SUBMIT><BR>&#060;input type=reset value=RESET><BR>&#060;/form><BR>&#060;/body><BR>&#060;/html><BR> &#060;%<BR> Dim strSQL<BR> Dim rstUSR<BR> DIM cn<BR> strSQL="Select * from guest"<BR> set cn=Server.CreateObject("ADODB.Connection")<BR> cn.open "DSN=guestdsn"<BR> set rstUSR=Server.CreateObject("ADODB.Recordset")<BR> rstUSR.Open strSQL,cn,1,3<BR> rstUSR.AddNew<BR> rstUSR("text1")=Request.Form("name")<BR> rstUSR("text2")=Request.Form("email")<BR> rstUSR.Update<BR> response.Write("the process is completed")<BR> &#037;&#062;<BR> <BR> <BR> <BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    1,315

    Default RE: database access error

    I am still new myself in ASP, but if I can just try to figure out:<BR>The name of the input texts are: text1 and text2.<BR>The name of your table fields (database) are: name and email.<BR>So, I would do:<BR>rsUSR("name") = Request.Form("text1")<BR>rsUSR("email") = Request.Form("text2")<BR><BR>I assume the code you put inside &#060;% ... &#037;&#062; belongs to procform.asp.<BR><BR>Hope that makes sense.<BR><BR>John Weeflaar

Posting Permissions

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