473,405 Members | 2,344 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Error with INSERT INTO statement for Access 2003

Invisible Bunny King
Hi. I have been trying to get a registration form for my website to work. On my testing server, it worked great. Once I ul it to my server, it does not work. I have check out other forums to get help, but nothing seems to work. At first, people thought it was a permissions problem, but that is not the case.
What happens is that when I submit the form to be inserted into my Access table, I receive an error saying it can not process the Execute on line 41, the line that would make the records go to my database.
Following is the code I have for the form. Please bear with me for the number of fields that I have in this form.
If anyone can offer suggestions, it would be much appreciated.
You can see this page in action at http://www.centreicehockey.com/register222.asp

Expand|Select|Wrap|Line Numbers
  1. <!--#include file="Connections/hockeycards.asp" -->
  2. <!--#include file="adovbs.inc"-->
  3. <%
  4. Dim objConn
  5. Dim dbPath
  6. Dim strSQL
  7. Dim tableName
  8. Dim rscustomers
  9. Dim mytransfer
  10. dbPath="/db/Hockeycards.mdb"
  11. sConnection="Provider=Microsoft.Jet.OLEDB.4.0; " & _
  12.             "Data Source=" & Server.MapPath(dbPath) & ";"
  13. Set objConn = Server.CreateObject("ADODB.Connection")
  14. objConn.mode =3 '3="adModeReadWrite
  15. LockType="adLockOptimistic"
  16. Set rscustomers = Server.CreateObject("ADODB.Recordset")
  17. tableName="CustomerList"
  18. strSQL="SELECT * FROM CustomerList"
  19. rscustomers.Open strSQL, sConnection
  20. CursorType="adOpenKeyset"
  21. CursorLocation="adUseServer"
  22.  
  23. FirstName = Request.Form("FirstName")
  24. LastName =Request.Form("LastName")
  25. Uname=Request.Form("Uname")
  26. Pass=Request.Form("Pass")
  27. Email=Request.Form("Email")
  28. PhoneNumber=Request.Form("PhoneNumber")
  29. FavoriteNHLPlayer=Request.Form("FavoriteNHLPlayer")
  30. BillingAddress=Request.Form("BillingAddress")
  31. BillingCity=Request.Form("BillingCity")
  32. BillingProvince=Request.Form("BillingProvince")
  33. BillingPostalCode=Request.Form("BillingPostalCode")
  34. ShippingAddress=Request.Form("ShippingAddress")
  35. ShippingCity=Request.Form("ShippingCity")
  36. ShippingProvince=Request.Form("ShippingProvince")
  37. ShippingPostalCode=Request.Form("ShippingPostalCode")
  38. Newsletter=Request.Form("Newsletter")
  39. If (Request.Form("Submit") <>"") Then
  40. mytransfer="INSERT INTO CustomerList VALUES ('" & _
  41.              FirstName & "', '" & _
  42.              LastName &"', '" & Uname & "', '" & _
  43.              Pass & "', '" & Email & "', '" & _
  44.              PhoneNumber & "', '" & FavoriteNHLPlayer & "', '" & _
  45.              ShippingAddress & "', '" & ShippingCity & "', '" & _
  46.              ShippingProvince & "', '" & ShippingPostalCode & "', '" & _
  47.              BillingAddress & "', '" & BillingCity & "', '" & _
  48.              BillingProvince & "', '" & BillingPostalCode & "', '" & _
  49.              Newsletter & "') "
  50. Set rscustomers.Execute(mytransfer)
  51. rscustomers.Close
  52. End If
  53.  
  54. Set rscustomers = Nothing
  55. Set objConn = Nothing
  56.  
  57. %>
  58.  
Thanks in advance to any replies.
Feb 17 '07 #1
5 2837
nico5038
3,080 Expert 2GB
Hard to diagnose from a distance, but here some links about using Access as a web enabled database:
http://members.optushome.com.au/anandasim/asp.htm#howdo
www.brinkster.com
Don't use Access on the web:
http://www.aspemporium.com/aspEmpori...seMSAccess.asp

In general I would check the required fields from the table before starting an INSERT.

Nic;o)
Feb 17 '07 #2
Nico,
Thanks for replying.
Boy, some of those links spooked me. Why not to use Access? Well, too late for that now...
Anyway, nothing in any of those links seemed to fix the problem. I tried a few other things, to no avail.
I have settled, for now, on an email form. I will manually enter the info into the database for now.
I think it's obvious that this is not the preferred method, but it will work 'til I get it working right.
Any other thoughts??

Hard to diagnose from a distance, but here some links about using Access as a web enabled database:
http://members.optushome.com.au/anandasim/asp.htm#howdo
www.brinkster.com
Don't use Access on the web:
http://www.aspemporium.com/aspEmpori...seMSAccess.asp

In general I would check the required fields from the table before starting an INSERT.

Nic;o)
Feb 20 '07 #3
nico5038
3,080 Expert 2GB
Checkout MS Access 2007 it has an email "datacollect" possibility and can store data on a SharePoint server.

Nic;o)
Feb 21 '07 #4
HI.
I looked into it. Yes, that is an option, but from my understanding, I can only do this if I send the email to people. The idea is that users go to a page on my site to register. Is there a way to make the Data collect work in this way?

Checkout MS Access 2007 it has an email "datacollect" possibility and can store data on a SharePoint server.

Nic;o)
Feb 22 '07 #5
nico5038
3,080 Expert 2GB
I'm no Sharepoint expert, but I would look into the possibilities of SharePoint.
It's specially designed for data exchange and easily linked to from Access.

Nic;o)
Feb 22 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
1
by: 2BaCook | last post by:
Hi, I have an Access database that I am creating a java front end to. I am trying to insert a record into a table and get a problem whenever I try to insert into my "Number" column. Here is my...
6
by: Squirrel | last post by:
I have a command button on a subform to delete a record. The only statement in the subroutine is: DoCmd.RunCommand acCmdDeleteRecord The subform's recordsource is "select * from tblVisit order...
2
by: jannordgreen | last post by:
I am using Winxp and Ms Access 2003. I get this error message: error 3137, Missing semicolon (;) at end of SQL statement when I run this code: Dim I As Integer For I = 0 To...
7
by: kosta | last post by:
hello! one of my forms communicates with a database, and is supposed to add a row to a table using an Insert statement... however, I get a 'oledb - syntax error' exception... I have double...
0
by: RG | last post by:
OleDbCommand.Prepare error: Size of parameter (VB.NET 2003) I need to do a SQL INSERT statement into an Access table, and I’d like to use the exact technique described in the Help file example...
2
by: Charles Wilt | last post by:
I have a IBM iSeries (aka AS-400) running v5r3 of OS/400 that I access via a linked server from SQL Server 2000. The following select works fine: select * from...
6
by: rn5a | last post by:
During registration, users are supposed to enter the following details: First Name, Last Name, EMail, UserName, Password, Confirm Password, Address, City, State, Country, Zip & Phone Number. I am...
2
by: teddysnips | last post by:
I have an application that does some data manipulation of some tables to format a table for a report. 1. First I open the table that gives me the parameters for some later queries strSQL =...
15
by: Dave | last post by:
I am getting the error above intermittantly with an ASP 3.0 page using an MS Access 2003 database. I have searched Google extensively and found the following possible causes for this error: A...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
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...
0
tracyyun
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.