Hi everyone, I am new to this so I have been trying to convert input from form (string) to different data types but can't get it to work. Keeps telling me there is syntax error or expected ')' no matter what way I write it. Have tried everything I think. Here is my completed code. If anyone can help I would be extremely grateful and thanks in advance. - <html>
-
<body>
-
-
<%
-
set conn=Server.CreateObject("ADODB.Connection")
-
conn.Provider="Microsoft.ACE.OLEDB.12.0"
-
conn.Open "c:/inetpub/wwwroot/Sparqs Database.accdb"
-
-
sql="INSERT INTO [Attendance]([S_id],[Institution_n],"
-
sql=sql & "[Training_level],[Training_type], [Session_date], [Session_time],[F_name], [S_name], [email], [Student_id], [Course_name], [Opt_in])"
-
sql=sql & " VALUES "
-
sql=sql & "('"& CONVERT(Request.Form("S_id" INTEGER) & "',"
-
sql=sql & "'" & Request.Form("Institution_n") & "',"
-
sql=sql & "'" & Request.Form("Training_level") & "',"
-
sql=sql & "'" & Request.Form("Training_type") & "',"
-
sql=sql & "'" & CONVERT(Request.Form("Session_date" DATE) & "',"
-
sql=sql & "'" & CONVERT(Request.Form("Session_time" TIME) & "',"
-
sql=sql & "'" & Request.Form("F_name") & "',"
-
sql=sql & "'" & Request.Form("S_name") & "',"
-
sql=sql & "'" & Request.Form("Email") & "',"
-
sql=sql & "'" & Request.Form("Student_id") & "',"
-
sql=sql & "'" & Request.Form("Course_name") & "',"
-
sql=sql & "'" & Request.Form("Opt_in") & "')"
-
-
on error resume next
-
conn.Execute sql,recaffected
-
if err<>0 then
-
Response.Write(Err.Description)
-
else
-
Response.Write("<h3>" & recaffected & " record added</h3>")
-
end if
-
conn.close
-
%>
-
-
</body>
-
</html>
6 2699
Thanks so much for getting back to me appreciate it, but unfortunately
error code now is:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
Here's the code up until now:
sql=sql & "('"& int32.convert(Request.Form("S_id") & "',")
/sparqs training site/Attendance.asp, line 12
Please use code tags when posting code.
You never close your convert functions.
Hi Rabbit,
Just wanted to apologise for lack of code tags.
Still having the same problem, just doesn't seem to work with any conversion that I use. I'll keep plugging away. Thanks.
Please show us the code after you've closed the convert functions.
hi Rabbit,
Just to say first of all thanks for looking at my problem, appreciate it.
After considerable research have finally found the correct format. Turns out that I had got it right before but that there is a problem with 64 bit OS, access 2010 and ADO/ASP conversion.
Working with strings is fine but the minute you try to convert there is a problem. They have suggested some resolutions and patches so going to give them a go. So I guess I can close the thread.
Thanks again.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Adrian Parker |
last post by:
Hello all. I have a Access database which I read records from. All the
records read fine, except the Date/Time field of the database is not being
properly assigned to my Date-Time-Picker control...
|
by: WUV999U |
last post by:
Hi
I am fairly new to VBA and want to know how I can convert or I mean
parse the XML file and convert to an access database.
Please help. I greatly appreciate your time and help.
I would be...
|
by: Ruy Castelli |
last post by:
I created a ASP.NET page using C# and I'm using two components to access a
MS-Access database, which are:
- oleDbConnection
- oleDataAdapter
The MS-Access database is in the correct...
|
by: Ruy Castelli |
last post by:
I created a ASP.NET page using C# and I'm using two components to access a
MS-Access database, which are:
- oleDbConnection
- oleDataAdapter
The MS-Access database is in the correct directory...
|
by: vigneshwaran G via DotNetMonster.com |
last post by:
Hi ,
I am trying ot connect a VB application to Access database.
iam using the following connection string :
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;data source=c:\...
|
by: Tony |
last post by:
I am trying this:
SQL = "INSERT INTO GradeList (Date) Values(#01-01-2007#)"
I get message "Syntax error in Insert statement".
How to add date field in access database?
|
by: sayli |
last post by:
I have 00:01:00 in a string.
I want to convert it into time format.
How can i do this?
|
by: ohadm |
last post by:
i've encountered a weired problem while retrieving date from access database:
i'm using ASP VBscript\Jscript
the data is stored using the "date()" command on VBscript code by someone else.
when...
|
by: pavanip |
last post by:
Hi all,
I am developing standalone application “To convert FOXPRO database to MS Access Database” I started to develop this application Using dot net Frame Work. I am not getting any help in net,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| | |