salman.pirani Posted November 13, 2012 Share Posted November 13, 2012 hello dear, am executing this query i dnt know why its nt working <%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "c:/webdata/sxsheet2.mdb"cid=Session("a")if cid="" thenset rs=Server.CreateObject("ADODB.Recordset")rs.open "SELECT * FROM tsf_form WHERE empid='" & cid & "'",connelsesql="UPDATE tsf_form SET " sql=sql & "Funded_by1='" & Request.Form("Funded_by1") & "'," sql=sql & " WHERE empid=" & cid & "" on error resume next conn.Execute sql if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end ifend ifconn.close%> Link to comment Share on other sites More sharing options...
justsomeguy Posted November 13, 2012 Share Posted November 13, 2012 You have an extra comma in the update query. Link to comment Share on other sites More sharing options...
salman.pirani Posted November 13, 2012 Author Share Posted November 13, 2012 where sir ? Link to comment Share on other sites More sharing options...
salman.pirani Posted November 13, 2012 Author Share Posted November 13, 2012 still nt wrking u were saying abut this rite sql=sql & "Funded_by1='" & Request.Form("Funded_by1") & "'," Link to comment Share on other sites More sharing options...
salman.pirani Posted November 13, 2012 Author Share Posted November 13, 2012 i tried this but still not working sir plz help <%set conn=Server.CreateObject("ADODB.Connection")conn.Provider="Microsoft.Jet.OLEDB.4.0"conn.Open "c:/webdata/sxsheet2.mdb"cid=Session("a")if Request.Form("des_exp1")="" thenset rs=Server.CreateObject("ADODB.Recordset")rs.open "SELECT * FROM tsf_form WHERE empid='" & cid & "'",connelsesql="UPDATE tsf_form SET " sql=sql & "des_exp1='" & Request.Form("des_exp1") & "'," sql=sql & "amount1='" & Request.Form("amount1") & "'" sql=sql & " WHERE empid=" & cid & "" on error resume next conn.Execute sql if err<>0 then response.write("No update permissions!") else response.write("Record " & cid & " was updated!") end ifend ifconn.close%> Link to comment Share on other sites More sharing options...
justsomeguy Posted November 13, 2012 Share Posted November 13, 2012 The syntax looks fine. It would help if you had it printing the error message to say what's wrong. Link to comment Share on other sites More sharing options...
salman.pirani Posted November 18, 2012 Author Share Posted November 18, 2012 its printing this i dnt know whats the error, UPDATE tsf_form SET des_exp1='sss',Vendor='AFN' WHERE empid=234 Link to comment Share on other sites More sharing options...
justsomeguy Posted November 19, 2012 Share Posted November 19, 2012 Again, the syntax looks fine. Why do you think there's an error? Link to comment Share on other sites More sharing options...
salman.pirani Posted November 22, 2012 Author Share Posted November 22, 2012 ow its workig i now exeuting this UPDATE tsf_form SET des_exp1='sss',Vendor='AFN' WHERE empid='234' Link to comment Share on other sites More sharing options...
salman.pirani Posted November 22, 2012 Author Share Posted November 22, 2012 but now i hav another query i want that a a refrence number generate autometicly take the max num from database bas and +1 into it but when the year change like in 2013 it will again start from 1 could you help me plz in this regards . thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted November 26, 2012 Share Posted November 26, 2012 You can use the MAX function to get the max value of a column. http://webcheatsheet.com/SQL/access_functions/max.php 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