choobakka Posted February 14, 2006 Author Share Posted February 14, 2006 i already did that Link to comment Share on other sites More sharing options...
choobakka Posted February 15, 2006 Author Share Posted February 15, 2006 any luck ASPNETGUY? Link to comment Share on other sites More sharing options...
aspnetguy Posted February 15, 2006 Share Posted February 15, 2006 any luck ASPNETGUY?<{POST_SNAPBACK}> I am afriad not I am having trouble getting the pages and datbase setup. I just don't have the time to play with it. sorry.It has been so long since I setup a ASP website on my local server... Link to comment Share on other sites More sharing options...
choobakka Posted February 15, 2006 Author Share Posted February 15, 2006 ok cool Link to comment Share on other sites More sharing options...
choobakka Posted February 18, 2006 Author Share Posted February 18, 2006 anybody else got any ideas? Link to comment Share on other sites More sharing options...
Siddhesh Posted March 2, 2006 Share Posted March 2, 2006 anybody else got any ideas?<{POST_SNAPBACK}> I think there some slip of mindplease check the SQL String for Update sql="UPDATE tblCustomer SET CustomerID="' & Request.Form("CustomerID") & "'," sql=sql & "Last_Name='" & Request.Form("Last_Name") & "'," sql=sql & "First_Name='" & Request.Form("First_Name") & "'," sql=sql & "Address1='" & Request.Form("Address1") & "'," sql=sql & "Address2='" & Request.Form("Address2") & "'," sql=sql & "Address3='" & Request.Form("Address3") & "'," sql=sql & "Post_Code='" & Request.Form("Post_Code") & "'," sql=sql & "Telephone1='" & Request.Form("Telephone1") & "'," sql=sql & "Telephone2='" & Request.Form("Telephone2") & "' " WHERE tblCustomer.[CustomerID]=" & CustomerID " Just Change the last line WHERE tblCustomer.[CustomerID]=" & CustomerID "By sql=sql & " WHERE tblCustomer.[CustomerID]=" & CustomerIDThats it. i think this ll solve the problem Link to comment Share on other sites More sharing options...
choobakka Posted March 2, 2006 Author Share Posted March 2, 2006 still no change.since copying the code from the tutorials on this site, the code within the tutorials has changed.so i added the new code but now i dont get any messages about not being able to update/delete. i simply get a blank screen and there is no change in the database. the new code is as follows:<html><head><title>Submit DataBase</title></head><body><h2>Submit to Database</h2><%on error resume nextset conn=Server.CreateObject("ADODB.Connection") conn.provider="Microsoft.Jet.OLEDB.4.0"conn.open(server.mappath("Disso1.mdb"))if Request.form("action")="Save" then CustomerID=Request.Form("CustomerID")sql="UPDATE tblCustomer SET CustomerID="' & Request.Form("CustomerID") & '"," sql=sql & "Last_Name='" & Request.Form("Last_Name") & "'," sql=sql & "First_Name='" & Request.Form("First_Name") & "'," sql=sql & "Address1='" & Request.Form("Address1") & "'," sql=sql & "Address2='" & Request.Form("Address2") & "'," sql=sql & "Address3='" & Request.Form("Address3") & "'," sql=sql & "Post_Code='" & Request.Form("Post_Code") & "'," sql=sql & "Telephone1='" & Request.Form("Telephone1") & "'," sql=sql & "Telephone2='" & Request.Form("Telephone2") & "' ," sql=sql & "Username='" & Request.Form("Username") & "' , " sql=sql & "Password='" & Request.Form("Password") & "' , "sql=sql & " WHERE tblCustomer.[CustomerID]=" & CustomerID' conn.Execute sql, Recordsaffected'if err <> 0 then' Response.Write("hello.")else' Response.Write("Record number " & CustomerID & " was updated.")' end if Response.Write("Submitting records not possible")end ifif Request.Form("action")="Delete" then CustomerID=Request.Form("CustomerID")' conn.Execute "DELETE FROM tblCustomer WHERE tblCustomer.[CustomerID]=" & CustomerID, Recordsaffected' if err <> 0 then' Response.Write("You do not have permission to delete a record from this database!")' else ' Response.Write("Record number " & no & " was deleted.")' end if Response.Write("Deleting records not possible")end ifconn.close%></body></html>from what i can see, the code in red has been added in the tutorials but i still get the same result. all i want to be able to do is update the records in the database. any other ideas would be greatly appreciated Link to comment Share on other sites More sharing options...
Siddhesh Posted March 3, 2006 Share Posted March 3, 2006 still no change....any other ideas would be greatly appreciated<{POST_SNAPBACK}> I m bit confused with the commented part and Red part in the code.Please Post Code with no Comments and Red statemets.it is interesting, because I m not facing any problem with the same code. Link to comment Share on other sites More sharing options...
choobakka Posted March 3, 2006 Author Share Posted March 3, 2006 what you see above is the FULL code for that ASP page. it is supposed to update data in my database when it is called from a button press on another ASP page!however, this does not happen, NOTHING HAPPENS!!!! Link to comment Share on other sites More sharing options...
Siddhesh Posted March 4, 2006 Share Posted March 4, 2006 what you see above is the FULL code for that ASP page. it is supposed to update data in my database when it is called from a button press on another ASP page!however, this does not happen, NOTHING HAPPENS!!!!<{POST_SNAPBACK}> Ok try thisif Request.form("action")="Save" then CustomerID=Request.Form("CustomerID")sql="UPDATE tblCustomer SET "sql=sql & "Last_Name='" & Request.Form("Last_Name") & "'," sql=sql & "First_Name='" & Request.Form("First_Name") & "'," sql=sql & "Address1='" & Request.Form("Address1") & "'," sql=sql & "Address2='" & Request.Form("Address2") & "'," sql=sql & "Address3='" & Request.Form("Address3") & "'," sql=sql & "Post_Code='" & Request.Form("Post_Code") & "'," sql=sql & "Telephone1='" & Request.Form("Telephone1") & "'," sql=sql & "Telephone2='" & Request.Form("Telephone2") & "' ," sql=sql & "Username='" & Request.Form("Username") & "' , " sql=sql & "Password='" & Request.Form("Password") & "' , "sql=sql & " WHERE tblCustomer.[CustomerID]=" & CustomerIDResponse.Write sqlResponse.EndThis will show you the querry in hte browser.Copy this querry and run it from backend(i.e. Querry analyser etc)Is it updating the record?? Link to comment Share on other sites More sharing options...
Dox33 Posted March 4, 2006 Share Posted March 4, 2006 I have the same problems:Using the examples of W3School, I have made some pages.The DataBase has permissions fo 'everyone', 'me', 'administrators', etc.ect....I'm running on LocalHost, under XP-SP2, IIS.Page1:<html> <body> <H1>Add a new record</H1> <form method="post" action="ADO_Test7.1.asp"> <table> <tr> <td>Date:</td> <td><input name="Date"></td> </tr> </tr> <tr> <td>Time:</td> <td><input name="Time"></td> </tr> <tr> <td>User:</td> <td><input name="User"></td> </tr> <tr> <td>Job:</td> <td><input name="Job"></td> </tr> <tr> <td>Doc type:</td> <td><input name="DocType"></td> </tr> <tr> <td>Doc ID:</td> <td><input name="DocId"></td> </tr> <tr> <td>Connector:</td> <td><input name="Connector"></td> </tr> <tr> <td>Destination:</td> <td><input name="Destination"></td> </tr> </table> <br /> <br /> <input type="submit" value="Add New"> <input type="reset" value="Cancel"> </form> </body></html>Page2:<html> <body> <% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open "D:/StreamServe/UOMS/WhatEver/Development/RunTime/DataBase/UOMS.mdb" sql="INSERT INTO UOMS (ID,Date,Time,User,Job,DocType,DocId,Connector,Destination) VALUE (" sql=sql & "'" & Request.Form("Date") & "'," sql=sql & "'" & Request.Form("Time") & "'," sql=sql & "'" & Request.Form("User") & "'," sql=sql & "'" & Request.Form("Job") & "'," sql=sql & "'" & Request.Form("DocType") & "'," sql=sql & "'" & Request.Form("DocId") & "'," sql=sql & "'" & Request.Form("Connector") & "'," sql=sql & "'" & Request.Form("Destination") & "')" on error resume next conn.Execute sql,recaffected if err<>0 then Response.Write("Error: " & err & " No update permissions!") else Response.Write("<h3>" & recaffected & " record added</h3>") end if conn.close %> </body></html>Result after addin a record:Error: -2147217900 No update permissions! The funny this is.... If I try to DELETE a record, or a bunch of records, that WORKS!So, I can destroy, but not create....Please help.... Link to comment Share on other sites More sharing options...
choobakka Posted March 4, 2006 Author Share Posted March 4, 2006 what do u mean Copy this querry and run it from backend(i.e. Querry analyser etc) Link to comment Share on other sites More sharing options...
Dox33 Posted March 4, 2006 Share Posted March 4, 2006 what do u mean Copy this querry and run it from backend(i.e. Querry analyser etc)<{POST_SNAPBACK}> I'm sorry....I do not understand what you mean. Link to comment Share on other sites More sharing options...
choobakka Posted March 5, 2006 Author Share Posted March 5, 2006 Siddhesh said on page 3: Copy this querry and run it from backend(i.e. Querry analyser etc)i dont know what that means! Link to comment Share on other sites More sharing options...
choobakka Posted March 15, 2006 Author Share Posted March 15, 2006 PROBLEM SOLVED i did some research and found out that the word 'password' is a reserved word in ADO/OLEDB. chnaged the name in the database and in the sql statement and it worked a charm.thanks for all your help guys Link to comment Share on other sites More sharing options...
aspnetguy Posted March 15, 2006 Share Posted March 15, 2006 PROBLEM SOLVEDÂ i did some research and found out that the word 'password' is a reserved word in ADO/OLEDB. chnaged the name in the database and in the sql statement and it worked a charm.thanks for all your help guys<{POST_SNAPBACK}> You could have wrote it this way [password] but changing it was probably the best choice anyways.Wow, 60+ posts and it turned out to be that....lol....I should have looked closer, shame on me for missing that Link to comment Share on other sites More sharing options...
ryan0926 Posted December 27, 2006 Share Posted December 27, 2006 I've been following you guys. I had the same problem. already change the permission of the gtks.mdf database uncheck readonly etc. i can read from the db. here is the code. Connected OK error: -2147217900 No update permissions!INSERT INTO ct_mstr (ct-nbr,ct-fname)VALUE('3','rya') I've been following you guys. I had the same problem. already change the permission of the gtks.mdf database uncheck readonly etc. i can read from the db. here is the code. Connected OK error: -2147217900 No update permissions!INSERT INTO ct_mstr (ct-nbr,ct-fname)VALUE('3','rya')already figure out my problem. some of my fields doesnt allow nulls.. i change them to allow nulls. it works tnx guys. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now