473,569 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trying to get ASP form to show up in Access Database

67 New Member
Hello, I am new to this forum but have read several posts and I thank you for your great assistance. I am stumped right now. I have a user registration form in asp that is set to a form method=registra tion.asp page. i will post my registration.as p page below.

I am hoping this asp page will connect to my access database called registration.md b with a table called registration. however, everytime i submit my registration information, I get an error page that says there is a programming error. I have the SAMS teach yourself ASP 3.0 book and have followed this but am having no luck. Does anyone know why this isn't working. The current page I have listed below is trying to use the dsn-less connection. I also tried the dsn connection but failed there too. Any help would be greatly appreciated. Thanks in advance - Jerry
_______________ _______________ _______________ _______________ ___

Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript %>
  2. <% Option Explicit %>
  3. <!--#include virtual="/adovbs.inc"-->
  4. <html>
  5. <body>
  6. <%
  7. Dim objConn
  8. Set objConn = Server.CreateObject("ADODB.Connection")
  9. objConn.ConnectionString="Driver={Microsoft Access Driver (*.mdb)};" & _
  10. "DBQ=C:\Documents and Settings\MM\Desktop\Website\registration.mdb"
  11. objConn.Open
  12.  
  13. Dim objRS, bolAlreadyExists
  14. If ((Request.Form("firstname") = "") OR (Request.Form("lastname") = "") _
  15.     OR (Request.Form("street") = "") OR (Request.Form("city") = "") _
  16.     OR (Request.Form("state") = "") OR (Request.Form("zipcode") = "") _
  17.     OR (Request.Form("birthdate") = "") oR (Request.Form("email") = "") _
  18.     OR (Request.Form("confirmemail") = "") oR (Request.Form("password") = "") _
  19.     OR (Request.Form("confirmpassword") = "") oR (Request.Form("question") = "") _
  20.     OR (Request.Form("answer") = "") oR (Request.Form("confirmanswer") = "") _
  21.     OR (Request.Form("interest") = "") oR (Request.Form("nonewsemail") = "") _
  22.     OR (Request.Form("hearabout") = "")
  23.  
  24.   Response.Write "<a href='registration.html'>"
  25.   Response.Write "You must enter values for all the fields."
  26.   Response.Write "</a>"
  27. Else
  28. bolAlreadyExists = False
  29. Set objRS = Server.CreateObject("ADODB.Recordset")
  30. objRS.Open "registration", objConn, , adLockOptimistic, adCmdTable
  31. Do While Not (objRS.EOF OR bolAlreadyExists)
  32. If (StrComp(objRS("email"), Request.Form("email"), _
  33. vbTextCompare) = 0) Then
  34. Response.Write "<a href='registration.html'>"
  35. Response.Write "Email address already found in table."
  36. Response.Write "</a>
  37. bolAlreadyExists = True
  38. End If
  39. objRS.MoveNext
  40. Loop
  41. If Not bolAlreadyExists Then
  42.  
  43. objRS.AddNew
  44.  
  45.     objRS("firstname") = Request.Form("firstname")
  46.     objRS("lastname") = Request.Form("lastname")
  47.     objRS("street") = Request.Form("street")
  48.     objRS("city") = Request.Form("city")
  49.     objRS("state") = Request.Form("state")
  50.     objRS("zipcode") = Request.Form("zipcode")
  51.     objRS("birthdate") = Request.Form("birthdate")
  52.     objRS("email") = Request.Form("email")
  53.     objRS("confirmemail") = Request.Form("confirmemail")
  54.     objRS("password") = Request.Form("password")
  55.     objRS("confirmpassword") = Request.Form("confirmpassword")
  56.     objRS("question") = Request.Form("question")
  57.     objRS("answer") = Request.Form("answer")
  58.     objRS("confirmanswer") = Request.Form("confirmanswer")
  59.     objRS("awardprogram") = Request.Form("awardprogram")
  60.     objRS("accountnumber") = Request.Form("accountnumber")
  61.     objRS("interest") = Request.Form("interest")
  62.     objRS("nonewsemail") = Request.Form("nonewsemail")
  63.     objRS("hearabout") = Request.Form("hearabout")
  64.     objRS.Update
  65.     Response.Write "Thank you for registering."
  66.   End If
  67.   objRS.Close
  68.   Set objRS = Nothing
  69. End If
  70. objConn.Close
  71. Set objConn = Nothing
  72. %>
  73. </body>
  74. </html>
Oct 28 '08 #1
24 3684
jerrydigital
67 New Member
one other question to go with my previous post. i am currently trying to use html/asp/microsoft access. would it be easier to use php/mysql? i have a hosting account at godaddy and they allow both i believe. i have read that php/mysql is easier but i have set everything up in asp/access thus far. just curious because i am new to web design but very facinated by it. my webpage is pretty basic. just a page for users to register, then check their points earned balances and edit their registration info if necessary. if i can figure out how to get their user info into a database, i feel i am almost there.

any guidance to the correct scripting languages would be very beneficial.

thanks in advance - Jerry
Oct 29 '08 #2
DrBunchman
979 Recognized Expert Contributor
Hi Jerry,

Firstly, welcome to Bytes.com! I hope you find the site useful.

Secondly, please don't forget to wrap your code in CODE tags - it makes your posts much easier to read - and please read the Posting Guidelines if you have not done so already.

Could you print the error that you are getting on your page please. Make sure that you have Friendly HTTP Error Messages turned off in your browser options so you can see the actual error that is being returned.

Thanks,

Dr B
Oct 29 '08 #3
jerrydigital
67 New Member
Thank you for your quick response Dr. B. Below is the error message I am getting. My connection to the internet is fine so I am not sure what is going on. Any ideas?

_______________ _______________ _______________ _______________ __

Internet Explorer cannot display the webpage

Most likely causes:
You are not connected to the Internet.
The website is encountering problems.
There might be a typing error in the address.

What you can try:
Diagnose Connection Problems

More information

This problem can be caused by a variety of issues, including:

Internet connectivity has been lost.
The website is temporarily unavailable.
The Domain Name Server (DNS) is not reachable.
The Domain Name Server (DNS) does not have a listing for the website's domain.
If this is an HTTPS (secure) address, click Tools, click Internet Options, click Advanced, and check to be sure the SSL and TLS protocols are enabled under the security section.

For offline users

You can still view subscribed feeds and some recently viewed webpages.
To view subscribed feeds

Click the Favorites Center button , click Feeds, and then click the feed you want to view.

To view recently visited webpages (might not work on all pages)

Click Tools , and then click Work Offline.
Click the Favorites Center button , click History, and then click the page you want to view.
Oct 29 '08 #4
jerrydigital
67 New Member
The last post was the error message I received when I tried to submit offline.
When I put my webpages on the ftp client and try to submit, I get the following error message.
_______________ _______________ _______________ _____________

Microsoft VBScript compilation error '800a03ee'

Expected ')'

/registration.as p, line 22

OR (Request.Form(" hearabout") = "")
-----------------------------------^
Oct 29 '08 #5
jerrydigital
67 New Member
sorry for multiple posts but I went into my registration.as p page and deleted the
"hearabout" line that caused the problem last time and got the following error message. I really appreciate your help. Thanks again.
_______________ _______________ _______________ ___________


Microsoft VBScript compilation error '800a03ee'

Expected ')'

/registration.as p, line 24

Response.Write "<a href='registrat ion.html'>"
^
Oct 29 '08 #6
DrBunchman
979 Recognized Expert Contributor
The error is obviously that you have a missing parenthesis somewhere but the question is where. Can you print a bit more of the code that comes before this line so I can see what is going on please.

Thanks,

Dr B
Oct 29 '08 #7
jerrydigital
67 New Member
i am not sure what code you would like me to post but here is the registration.as p page I have been using. If you would like me to post anything else, please let me know.

Expand|Select|Wrap|Line Numbers
  1. <%@ Language=VBScript %>
  2. <% Option Explicit %>
  3. <!--#include virtual="/adovbs.inc"-->
  4. <html>
  5. <body>
  6. <%
  7. Dim objConn
  8. Set objConn = Server.CreateObject("ADODB.Connection")
  9. objConn.ConnectionString="Driver={Microsoft Access Driver (*.mdb)};" & _
  10. "DBQ=C:\Documents and Settings\MM\Desktop\Website\registration.mdb"
  11. objConn.Open
  12.  
  13. Dim objRS, bolAlreadyExists
  14. If ((Request.Form("firstname") = "") OR (Request.Form("lastname") = "") _
  15.     OR (Request.Form("street") = "") OR (Request.Form("city") = "") _
  16.     OR (Request.Form("state") = "") OR (Request.Form("zipcode") = "") _
  17.     OR (Request.Form("birthdate") = "") oR (Request.Form("email") = "") _
  18.     OR (Request.Form("confirmemail") = "") oR (Request.Form("password") = "") _
  19.     OR (Request.Form("confirmpassword") = "") oR (Request.Form("question") = "") _
  20.     OR (Request.Form("answer") = "") oR (Request.Form("confirmanswer") = "") _
  21.     OR (Request.Form("interest") = "") oR (Request.Form("nonewsemail") = "") _
  22.  
  23.  
  24.   Response.Write "<a href='registration.html'>"
  25.   Response.Write "You must enter values for all the fields."
  26.   Response.Write "</a>"
  27. Else
  28. bolAlreadyExists = False
  29. Set objRS = Server.CreateObject("ADODB.Recordset")
  30. objRS.Open "registration", objConn, , adLockOptimistic, adCmdTable
  31. Do While Not (objRS.EOF OR bolAlreadyExists)
  32. If (StrComp(objRS("email"), Request.Form("email"), _
  33. vbTextCompare) = 0) Then
  34. Response.Write "<a href='registration.html'>"
  35. Response.Write "Email address already found in table."
  36. Response.Write "</a>
  37. bolAlreadyExists = True
  38. End If
  39. objRS.MoveNext
  40. Loop
  41. If Not bolAlreadyExists Then
  42.  
  43. objRS.AddNew
  44.  
  45.     objRS("firstname") = Request.Form("firstname")
  46.     objRS("lastname") = Request.Form("lastname")
  47.     objRS("street") = Request.Form("street")
  48.     objRS("city") = Request.Form("city")
  49.     objRS("state") = Request.Form("state")
  50.     objRS("zipcode") = Request.Form("zipcode")
  51.     objRS("birthdate") = Request.Form("birthdate")
  52.     objRS("email") = Request.Form("email")
  53.     objRS("confirmemail") = Request.Form("confirmemail")
  54.     objRS("password") = Request.Form("password")
  55.     objRS("confirmpassword") = Request.Form("confirmpassword")
  56.     objRS("question") = Request.Form("question")
  57.     objRS("answer") = Request.Form("answer")
  58.     objRS("confirmanswer") = Request.Form("confirmanswer")
  59.     objRS("awardprogram") = Request.Form("awardprogram")
  60.     objRS("accountnumber") = Request.Form("accountnumber")
  61.     objRS("interest") = Request.Form("interest")
  62.     objRS("nonewsemail") = Request.Form("nonewsemail")
  63.     objRS("hearabout") = Request.Form("hearabout")
  64.     objRS.Update
  65.     Response.Write "Thank you for registering."
  66.   End If
  67.   objRS.Close
  68.   Set objRS = Nothing
  69. End If
  70. objConn.Close
  71. Set objConn = Nothing
  72. %>
  73. </body>
  74. </html>
Oct 29 '08 #8
GazMathias
228 Recognized Expert New Member
Hiya,

I think your problem is that you open a parenthesis here:

Expand|Select|Wrap|Line Numbers
  1. If ((Request.Form("firstname") = "") OR (Request.Form("lastname") 
But I can't find where it is closed.
Oct 29 '08 #9
jerrydigital
67 New Member
thank you for your response.

i added a parentheses at the end of this statement after "nonewsemai l"

Expand|Select|Wrap|Line Numbers
  1. Dim objRS, bolAlreadyExists
  2. If ((Request.Form("firstname") = "") OR (Request.Form("lastname") = "") _
  3.     OR (Request.Form("street") = "") OR (Request.Form("city") = "") _
  4.     OR (Request.Form("state") = "") OR (Request.Form("zipcode") = "") _
  5.     OR (Request.Form("birthdate") = "") oR (Request.Form("email") = "") _
  6.     OR (Request.Form("confirmemail") = "") oR (Request.Form("password") = "") _
  7.     OR (Request.Form("confirmpassword") = "") oR (Request.Form("question") = "") _
  8.     OR (Request.Form("answer") = "") oR (Request.Form("confirmanswer") = "") _
  9.     OR (Request.Form("interest") = "") oR (Request.Form("nonewsemail") = "")) Then
  10.  
  11.  
  12.   Response.Write "<a href='registration.html'>"
  13.   Response.Write "You must enter values for all the fields."
  14.   Response.Write "</a>"
after i made the above change, i got the following error code.
_______________ _______________ _______________ _____

Microsoft VBScript compilation error '800a0409'

Unterminated string constant

/registration.as p, line 36

Response.Write "</a>
--------------------^
Oct 29 '08 #10

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

Similar topics

2
3540
by: Pete | last post by:
Before I get started with the question, does anyone have a (single) good book recommendation for database design? Not an Access-specific book, but something geared toward helping me figure out *what the user wants*. I've had brief formal education about data flow diagramming, but I'm looking for ... more, now that I'm actually running into...
1
2009
by: Michael Eisner | last post by:
I have an MS Access 8.0 (Office97) program that has a form called FO-008 that I need to replace on several users computers in different locations without me being there doing it manually. I'm trying to perform the replacement by using an external MS Access program that contains the replacement form also called FO-008. I need to keep the...
3
10643
by: RAllsopp | last post by:
I have a client who would like to have several pictures associated with one system. I have read about storing only the pathname to save OLE overhead and have set-up a form for my client to browse/add one picture at a time to a system. Now he would like to 'view' all of the thumbnails associated with any system on a single form. I can...
10
2008
by: motessa | last post by:
Hello All, I am new to Access and have been looking for answers to my problem on the internet and have not found it yet. I hope someone can give me a hint. Thanks so much. I have a form (called: myform) in which there is a combo (combo1) and a button (button1). In properties for combo1, I use "Value List" for Row Source Type and in Row...
4
3609
by: raj_genius | last post by:
I hav two queries, whc are as follows: FIRSTLY: is it possible to access the controls(by name) of a parent form(MDI) from its child forms??if yes then how??plzz provide a coded example in VB if possible.. for example..i hav a menu in the parent form named "Administrator" whic has an item "mnuLogIn"..now when i click on login..another child...
3
3162
by: Robertf987 | last post by:
Well, I think I've described what I want to do in the title here. In the database, I have two main tables that contain the main data for the database. One for group expenditures, another for application details. I have a query for each of them to copy all the contents of the table into a new table, then delete all the data from the main table....
9
18007
by: RvGrah | last post by:
I'm completely new to using background threading, though I have downloaded and run through several samples and understood how they worked. My question is: I have an app whose primary form will almost always lead to the user opening a certain child window that's fairly resource intensive to load. Is it possible to load this form in a...
1
4014
by: Sunray | last post by:
I have a form called the sales form and i have 2 sets of listboxes So what happens is. i add items form the bottom set of list boxes which are bound to a data base to the top set of list boxes which are not bound, I select from the bottom set and add to the top set which works fine, but now i decide to remove an item from the top set. when i...
7
4136
by: Icarus | last post by:
I have a Access 2000 database that I am opening with Access 2007. When I open the datbase in Access 2000 or Access 2003, the database runs as expected. In Access 2007 my main form opens, a form with multiple tabs and subforms, the form now takes a "very" long time (more than 10 minutes) to load. Has anyone come across this before, and...
0
7695
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8119
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7668
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7964
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.