Help

Results 1 to 5 of 5

Thread: Help

  1. #1
    Join Date
    Dec 1969
    Posts
    108

    Default Help

    Could anyone help me out with this problem, I have supplied the code below:<BR><BR>Error Type: <BR>Microsoft OLE DB Provider for ODBC Drivers (0x80004005) <BR>[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query. <BR><BR><BR>Also here is the code: <BR><BR>strConn = Application("HouseSwap_ConnectionString") <BR>Set objConn = Server.CreateObject("ADODB.Connection") <BR>objConn.open strConn <BR>Set objRst = Server.CreateObject("ADODB.Recordset") <BR>Set objCmd = CreateObject("ADODB.Command") <BR>Set objCmd.ActiveConnection = objConn <BR><BR>&#039; Check whether username already registered <BR>sSQL = "SELECT Username FROM MemberDetails " &_ <BR> "WHERE Username=&#039;" & strUsername & "&#039;" <BR>objcmd.CommandText = sSQL <BR>Set objRst = objCmd.Execute <BR>if not objRst.EOF then <BR>ErrMsg = "Please choose a different username." <BR>AllValuesGood = false <BR>end if <BR><BR><BR>if AllValuesGood &#060;&#062; false then <BR><BR>sSQL = "select max(HUIndex) as MaxUIndex from House" <BR>objcmd.CommandText = sSQL <BR>Set objRst = objCmd.Execute <BR>if not objRst.EOF then <BR>MaxHouseUIndex = objRst(0).value + 1 <BR>else <BR>MaxHouseUIndex = 1 <BR>end if <BR>if isnull(MaxHouseUIndex) then MaxHouseUIndex = 1 <BR><BR>sSQL = "INSERT INTO House VALUES( " &_ <BR> "" & MaxHouseUIndex & "," &_ <BR> "&#039;" & strtown & "&#039;," &_ <BR> "&#039;" & strcounty & "&#039;," &_ <BR> "&#039;" & strcountry & "&#039;," &_ <BR> "" & strpeopleinhse & "," &_ <BR> "&#039;" & strtypeofres & "&#039;," &_ <BR> "&#039;" & strnearestcity & "&#039;," &_ <BR> "&#039;" & strdistancefromcity & "&#039;," &_ <BR> "&#039;" & strdescofhse & "&#039;)" <BR>Response.Write sSQL & " <BR>" <BR>objcmd.CommandText = sSQL <BR>Set objRst = objCmd.Execute <BR>&#039;objConn.Execute sSQL <BR><BR>&#039; Update <BR>IF updateHouse &#060;&#062; "" THEN <BR>sSQL = "UPDATE House SET( " &_ <BR> "" & MaxHouseUIndex & "," &_ <BR> "&#039;" & strtown & "&#039;," &_ <BR> "&#039;" & strcounty & "&#039;," &_ <BR> "&#039;" & strcountry & "&#039;," &_ <BR> "" & strpeopleinhse & "," &_ <BR> "&#039;" & strtypeofres & "&#039;," &_ <BR> "&#039;" & strnearestcity & "&#039;," &_ <BR> "&#039;" & strdistancefromcity & "&#039;," &_ <BR> "&#039;" & strdescofhse & "&#039;)" <BR>&#039; Response.Write sSQL & " <BR>" <BR>objcmd.CommandText = sSQL <BR>Set objRst = objCmd.Execute <BR>&#039; objConn.Execute sSQL <BR><BR>%&#062; <BR>&#060;center&#062; <BR>&#060;table width="600" cellpadding="4" <BR> cellspacing="0" bgcolor=#666666&#062; <BR>&#060;tr&#062; <BR> &#060;td&#062; <BR> &#060;%=Employee%&#062; was updated in the database <BR> &#060;/td&#062; <BR>&#060;/tr&#062; <BR>&#060;/table&#062; <BR>&#060;/center&#062; <BR>&#060;p&#062; <BR>&#060;% <BR>END IF <BR><BR>sSQL = "select max(MUIndex) as MaxUIndex from MemberDetails" <BR>objcmd.CommandText = sSQL <BR>Set objRst = objCmd.Execute <BR><BR>if not objRst.EOF then <BR>MaxMemberDetailsUIndex = objRst(0).value + 1 <BR>else <BR>MaxMemberDetailsUIndex = 1 <BR>end if <BR>if isnull(MaxMemberDetailsUIndex) then MaxMemberDetailsUIndex = 1 <BR><BR>if strfirstname = "" then strfirstname = "-" <BR>if strlastname = "" then strlastname = "-" <BR>if straddress = "" then straddress = "-" <BR>if strphoneno = "" then strphoneno = "-" <BR>if stremail = "" then stremail = "-" <BR>if strpaymethod = "" then strpaymethod = "-" <BR>if strccname = "" then strccname = "-" <BR>if strcctype = "" then strcctype = "-" <BR>if strccno = "" then strccno = "-" <BR>if strccexpirydate = "" then strccexpirydate = "-" <BR>if strusername = "" then strusername = "-" <BR>if strpassword = "" then strpassword = "-" <BR><BR>sSQL = "INSERT INTO MemberDetails values( " &_ <BR> "" & MaxMemberDetailsUIndex & "," &_ <BR> "" & MaxHouseUIndex & "," &_ <BR> "&#039;" & strfirstname & "&#039;," &_ <BR> "&#039;" & strlastname & "&#039;," &_ <BR> "&#039;" & straddress & "&#039;," &_ <BR> "&#039;" & strphoneno & "&#039;," &_ <BR> "&#039;" & stremail & "&#039;," &_ <BR> "&#039;" & strpaymethod & "&#039;," &_ <BR> "&#039;" & strccname & "&#039;," &_ <BR> "&#039;" & strcctype & "&#039;," &_ <BR> "&#039;" & strccno & "&#039;," &_ <BR> "&#039;" & strccexpirydate & "&#039;," &_ <BR> "&#039;" & strusername & "&#039;," &_ <BR> "&#039;" & strpassword & "&#039;)" <BR><BR>Response.Write ssql <BR>objcmd.CommandText = sSQL <BR>Set objRst = objCmd.Execute <BR>&#039;objConn.Execute sSQL <BR>Response.Redirect "welcomeuser.asp" <BR>else <BR>session("ErrMsg") = ErrMsg <BR>Response.Redirect "register.asp" <BR>end if <BR><BR>&#039;call adduser <BR>objConn.Close <BR>set objConn = Nothing <BR><BR>%&#062; <BR><BR>

  2. #2
    neils Guest

    Default RE: Help

    make sure that the IUSER_&#060;machinename&#062; user in windows has read/write permission to the database file and the folder it is contained in.

  3. #3
    Join Date
    Dec 1969
    Posts
    108

    Default RE: Help

    Sorry I know this is a stupid question but how do I do that?

  4. #4
    neils Guest

    Default RE: Help

    quite alright.<BR><BR>open up windows explorer and locate the folder with the database in it. if you&#039;re using IIS as your web server, then it&#039;s probably somewhere under c:inetpubwwwroot<BR><BR>right click on the folder and choose properties. from there you should find a security tab, click on that, and you will see the list of authorized users for that folder.<BR><BR>click add, and find the IUSER account. add that to the folder and give it read/write permissions. you might have to do the same thing for the actual file, but I&#039;m not sure.<BR><BR>Hope this helps.


  5. #5
    Join Date
    Dec 1969
    Posts
    108

    Default new prob

    That has helped me but I now have a new problem, I have 2 inserts in my code and one of them is inserting to the database, but the other isn&#039;t and the error is telling me that it is syntactically incorrect but I can&#039;t figure it out, here is the second insert:<BR><BR>sSQL = "INSERT INTO MemberDetails values( " &_<BR> "" & MaxMUIndex & "," &_<BR> "" & MaxHouseID & "," &_<BR> "&#039;" & strfirstname & "&#039;," &_<BR> "&#039;" & strlastname & "&#039;," &_<BR> "&#039;" & straddress & "&#039;," &_<BR> "&#039;" & strphoneno & "&#039;," &_<BR> "&#039;" & stremail & "&#039;," &_<BR> "&#039;" & strpaymethod & "&#039;," &_<BR> "&#039;" & strccname & "&#039;," &_<BR> "&#039;" & strcctype & "&#039;," &_<BR> "&#039;" & strccno & "&#039;," &_<BR> "&#039;" & strccexpirydate & "&#039;," &_<BR> "&#039;" & strusername & "&#039;," &_<BR> "&#039;" & strpassword & "&#039;)"<BR><BR> &#039;Response.Write ssql<BR> objcmd.CommandText = sSQL<BR> Set objRst = objCmd.Execute<BR> &#039;objConn.Execute sSQL<BR><BR>thanks

Posting Permissions

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