Hello Friends,
I am getting problem in sending the user data filled in the html forms to my access database.
i.e., if the user types his name as
Hari Ba'bu
(datatype is text in field desgin)
and other field datas are given etc.,
then I am getting the following error
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''hari ba'bu',2,285,'aaa aaaa','','','','','bbb bbbb','bbb bbbbb','bbb bbbb','bbb4444',735,'12/28/02')'.
and if the user types his name without single quotes then the record is inserted properly.
So , give me the solution to insert the records along with single quote's
with regards
hari
Bullschmidt
01-08-2003, 03:31 PM
And just for reference here are a few articles about that:
How to Deal with Apostrophes in your SQL String - 5/18/1999
http://www.4guysfromrolla.com/webtech/051899-1.shtml
Just uses a Replace function.
Replacing Single Quotes when formatting SQL
http://www.aspfree.com/asp/startpage.asp?id=38
Just uses a Replace function.
Properly encoding a SQL statement by Robert Chartier nothingmn@netexecutive.com
http://www.aspfree.com/asp/startpage.asp?id=46
Just uses a Replace function.
HOWTO: Handle Quotes and Pipes in Concatenated SQL Literals
http://support.microsoft.com/support/kb/articles/q178/0/70.asp
hari
03-08-2003, 11:37 PM
Hello Developer,
I am collecting the personal details from my customer while he registers and storing it in the database. (he selected his country has india) from the list of countries ( i stored all the countries with unique code in a table) from their i am listing in the registration form.
but , When he needs to edit his profile i have to show the selected country when he registered as first and the remaining all in the list.How to do this?
I stored all the personal details of my customer along with unique code of india (eg . 5) in another table
regards
hari
Ribeyed
03-09-2003, 08:36 AM
hi,
sorry but i think your missing the "end if":
<option value="AL" <%If myRst.Fields("state") = "AL" Then Response.Write("selected")%>>Alabama</option>
<option value="AK" <%If myRst.Fields("state") = "AK" Then Response.Write("selected")%>>Alaska</option>
<option value="AB" <%If myRst.Fields("state") = "AB" Then Response.Write("selected")%>>Alberta</option>
cont.......
<option value="AL" <%If myRst.Fields("state") = "AL" Then Response.Write("selected") End If%>>Alabama</option>
<option value="AK" <%If myRst.Fields("state") = "AK" Then Response.Write("selected") End If%>>Alaska</option>
<option value="AB" <%If myRst.Fields("state") = "AB" Then Response.Write("selected") End If%>>Alberta</option>
cont........
hari
03-19-2003, 01:56 PM
Hello
This is a Time allotment system project using ASP.
I am listing up all the plants in select box along with departments,start time and end time to be assigned by the admin for the employees.
He may have n no of plants and he will assign the duty time for varoius plants for a day , by selecting the time as order.
How to send this datas to the table .
i.e assume if he allot duties for a employee
Worker Code selecting from theselect box ( Selecting the name) fetching the code from the value attribute.
Start time End Time Plant department (currently assume 3 plants in the company)
9 11 plant2 department3 (all are in the select box)
11 14 plant3 department2 (all are in the select box)
14 17 plant1 department1 (all are in the select box)
I have to insert these records i.e (3)tothe table , along with the admin employee code (whose assigning the job) the worker code (to whom assigned the job) with todays date when he submits the form
regards
hari
currently I finished it by assuming 3 plants in the company.
Following is the code :
******************************************
first page i am sending it by attachment empcategory.asp
rs1.Open "admins",con
compqry1="select * from admins"
Set rs1=con.execute(compqry1)
flag=0
if not rs1.bof <> rs1.eof then
rs1.movefirst
while not rs1.eof
if rs1("user")=Session("user") AND rs1("pwd")=Session("pwd") then
flag=1
end if
rs1.movenext
wend
end if
if flag=0 then
Response.write("This Page can be accessed only by the Authenticated Administrators")
Response.end
end if
rs1.close
Hello
This is a Time allotment system project using ASP.
I am listing up all the plants in select box along with departments,start time and end time to be assigned by the admin for the employees.
He may have n no of plants and he will assign the duty time for varoius plants for a day , by selecting the time as order.
How to send this datas to the table .
i.e assume if he allot duties for a employee
Worker Code selecting from theselect box ( Selecting the name) fetching the code from the value attribute.
Start time End Time Plant department (currently assume 3 plants in the company)
9 11 plant2 department3 (all are in the select box)
11 14 plant3 department2 (all are in the select box)
14 17 plant1 department1 (all are in the select box)
I have to insert these records i.e (3)tothe table , along with the admin employee code (whose assigning the job) the worker code (to whom assigned the job) with todays date when he submits the form
regards
hari
currently I finished it by assuming 3 plants in the company.
Following is the code :
******************************************
first page i am sending it by attachment empcategory.asp
rs1.Open "admins",con
compqry1="select * from admins"
Set rs1=con.execute(compqry1)
flag=0
if not rs1.bof <> rs1.eof then
rs1.movefirst
while not rs1.eof
if rs1("user")=Session("user") AND rs1("pwd")=Session("pwd") then
flag=1
end if
rs1.movenext
wend
end if
if flag=0 then
Response.write("This Page can be accessed only by the Authenticated Administrators")
Response.end
end if
rs1.close