where is the error??????

Results 1 to 4 of 4

Thread: where is the error??????

  1. #1
    Gabot Guest

    Default where is the error??????

    The server is enable to uptade my access database because it can&#039;t find the line I want to update: Error occur in line "objRS.update"<BR><BR>There is my code:<BR><BR>&#060;%@ LANGUAGE=VBSCRIPT %&#062;<BR>&#060;% Option Explicit %&#062;<BR><BR>HTML CODE (BODY ETC) <BR><BR>&#060;%<BR><BR> Const adCmdTable = &H0002<BR> Const adLockOptimistic = 3<BR> Session("Prenom") = Request("prenom") <BR> Session("Nom") = Request("nom")<BR> Session("Telephone") = Request("Telephone")<BR> Session("Email") = Request("email")<BR> Session("Age") = Request("age")<BR> Session("ville") = Request("ville")<BR> Session("descriptionPerso") = Request("description")<BR> Session("Race") = Request("race")<BR> Session("NomPerso") = Request("NomPerso")<BR> <BR> &#039;*************Connecting to Access Database<BR> dim dbfile<BR> dbfile=Server.MapPath("joueurs.mdb") <BR> dim OBJdbConnection<BR> Set OBJdbConnection=Server.CreateObject("ADODB.Connect ion")<BR> OBJdbConnection.Open "driver={Microsoft Access Driver (*.mdb)};dbq="&dbfile<BR><BR> &#039;***********End of Database Connection<BR><BR>Dim objRS<BR>Set objRS = Server.CreateObject ("ADODB.Recordset")<BR>objRS.Open "Joueur",OBJdbConnection, ,adLockOptimistic,adCmdTable<BR><BR>objRS.MoveFirs t<BR>Do While Not objRS.EOF<BR> <BR> If Session("NoJoueur") = objRS("No") Then<BR> objRS("Prenom") = session("prenom") <BR> &#039;objRS("Nom") = Session("Nom")<BR> &#039;objRS("Telephone") = Session("Telephone")<BR> &#039;objRS("Email") = Session("Email")<BR> &#039;objRS("Age") = Session("Age")<BR> &#039;objRS("ville") = Session("ville")<BR> &#039;objRS("description") = request("description")<BR> &#039;objRS("NomPerso") = Session("NomPerso")<BR> objRS.Update<BR> <BR> End if<BR><BR>objRS.MoveNext<BR>Loop<BR><BR>objRS.clos e<BR>set objRS = Nothing<BR>OBJdbConnection.close<BR>set OBJdbConnection = Nothing<BR><BR>&#039;response.redirect "default.asp"<BR>%&#062;<BR>

  2. #2
    el ganĂ² Guest

    Default RE: where is the error??????

    you are generating a PIBKAC error.

  3. #3
    Join Date
    Dec 1969

    Default Where? In the whole concept...

    Urk. Sorry, but you are doing that *ALL WRONG*.<BR><BR>For starters, why are you putting all the info into Session variable values? I can understand putting the username there, but *all* the info from the form? Why?<BR><BR>But ignoring that...<BR><BR>That&#039;s a pretty ugly way to try to update a record! Looping through all the records by hand!<BR><BR>And you are mis-interpreting the error you are getting. The server doesn&#039;t have any trouble finding the "line" where the update is. If it couldn&#039;t find that line, you wouldn&#039;t get the error. I would *bet* that it is actually saying that the table is not open for writing. Because of the way you opened the recordset.<BR><BR>You need to learn some elementary SQL, so that you can *at least* choose just the one record to update. Even better, so you can use a SQL "UPDATE" statement instead of doing it the way you are.<BR><BR>You might want to start here:<BR>http://w3.one.net/~jhoffman/sqltut.htm<BR><BR>

  4. #4
    Join Date
    Dec 1969

    Default You *will* explain that...

    ...or we will all come camp on your doorstep.<BR><BR>What the hell is a PIBKAC error?<BR><BR>Puberty In Boys Keeps Adults Crazy???<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