473,396 Members | 1,858 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,396 software developers and data experts.

Registration Form - Error ?

I've taken the following code from a developers web site which should allow
a user to register and receive an email message with a link to activate
their account, but when I click the link on my home page to take me to the
'registration.aspx' page, it throws up the following error message and I
can't figure out why.

------------------------------------------------------------------------------
Server Error in '/' Application.

--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required
to service this request. Please review the following specific error details
and modify your source code appropriately.

Compiler Error Message: BC30002: Type 'OleDbConnection' is not defined.

Source Error:

Line 9: Dim MySQL as string = "Insert into Members (uid, pwd, fullname,
email) " & _
Line 10: "Values (@uid, @pwd, @fullname, @email)"
Line 11: Dim MyConn as New OleDbConnection(strConn)
Line 12: Dim Cmd as New OleDbCommand(MySQL, MyConn)
Line 13: With Cmd.Parameters
Source File: d:\websites\swin644498\www\members\Registration.as px Line:
11

------------------------------------------------------------------------------

The code is in two pages, the first page I called registration.aspx and the
second is called Activation.aspx

registration.aspx

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script language="VB" runat="server">

Sub doInsert(Source as Object, E as EventArgs)
Dim strConn as String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"Data Source=d:\websites\swin644498\databases\userAccoun ts.mdb" & ";"
Dim MySQL as string = "Insert into Members (uid, pwd, fullname, email) " &
_
"Values (@uid, @pwd, @fullname, @email)"
Dim MyConn as New OleDbConnection(strConn)
Dim Cmd as New OleDbCommand(MySQL, MyConn)
With Cmd.Parameters
.Add(New OleDbParameter("@uid", frmuid.text))
.Add(New OleDbParameter("@pwd", frmpwd.text))

.Add(New OleDbParameter("@fullname", frmfullname.text))
.Add(New OleDbParameter("@email", frmemail.text))
End With
MyConn.Open()
cmd.ExecuteNonQuery()
MyConn.Close
'Put a label on your page to contain the 'success' response:
label1.text="Thank you for signing up. An email will be sent to you
shortly." & _
"Your response will be needed from that email to activate your account"
doEmail
End Sub

Sub doEmail(Source as Object, E as EventArgs)
Dim objMail as New MailMessage
objMail.To=txtEmail.text
objMail.FROM="em***@domain.com"
objMail.SUBJECT="Congratulations, only one more step to go"
objMail.BODY="To complete the registration on our site, " & _
"please click on the link below" & vbcrlf & vbcrlf & _
"http://Activation.aspx?uid=" & txtUID.text
objMail.BodyFormat = MailFormat.Text
SmtpMail.SmtpServer="email.server.com"
SmtpMail.Send(objMail)
End Sub

</script>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Registration</title>
</head>

<body>

<form Name="form1" runat="server">
<table>
<tr>
<td align="right">uid</td>
<td> <asp:textbox id="frmuid" runat="server" /></td>
</tr>
<tr>
<td align="right">pwd</td>
<td> <asp:textbox id="frmpwd" runat="server" /></td>
</tr>
<tr>
<td align="right">fullname</td>
<td> <asp:textbox id="frmfullname" runat="server" /></td>
</tr>
<tr>
<td align="right">email</td>
<td> <asp:textbox id="frmemail" runat="server" /></td>
</tr>

<td align="right">
<asp:button
id="button1"
onclick="doInsert"
Text="Submit" runat="server" />
</td>
</tr>
</table>
</form>

</body>

</html>
----------------------------------------------------------------------------------------------------------

Activation.aspx

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="VB" runat="server">
Dim sUID as String
Sub Page_Load(Source as Object, E as EventArgs)
sUID=request.QueryString ("uid")
Dim strConn as String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"Data Source=d:\websites\swin644498\databases\userAccoun ts.mdb" & ";"
Dim MySQL as string = "Update Members Set verify='YES' where UID='" & sUID
& "'"
Dim MyConn as New OleDbConnection(strConn)
Dim Cmd as New OleDbCommand(MySQL, MyConn)
MyConn.Open()
cmd.ExecuteNonQuery()
Label1.text="Thank you. Your email address has been verified." & _
"You may now use your User ID and PWD to login to the site"
MyConn.Close
End Sub
</script>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Activation</title>
</head>

<body>

</body>

</html>
--------------------------------------------------------------------------------

Can anyone see anything really obvious with the above code that I may be
overlooking, I followed the instructions to the letter on the developers web
site where I found the example but I just can't seem to get it to work.

The only change I made was to the following line:

Dim strConn as String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
server.mappath("\userAccounts.mdb") & ";"And I changed this to read:

Dim strConn as String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
"Data Source=d:\websites\swin644498\databases\userAccoun ts.mdb" & ";"

Any help or pointers would be grately appreciated.

Many thanks
Wayne
Jun 27 '06 #1
0 1609

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: karolina | last post by:
Hi, I am making a small registration form about cars in three steps. The first step is to fill in member data. After filled out the member data hit "next" and enter car information. Hit "next"...
1
by: JaNE | last post by:
Hello, I have made my cms... and is working, but have some, let me say "bugs"... And I don't know all reasons, please allow me slightly longer and most probably confusing post (that "confusing" is...
0
by: Marcel - IDUG Europe 2005 | last post by:
Dear DB2 user, My name is Marcel Lévy and I'm a member of the IDUG 2005 Europe Conference Planning Committee. ********************************************************************* Mark your...
4
by: Todd Greenwood-Geer | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Python-list - I'd like to publish to PyPI. I'm assuming that this is open to anyone. So here's my repro case for trying to register for an...
1
by: delusion7 | last post by:
Trying to create a table and insert records from a webform and I keep getting this message: "Successfully created the registration table. Unable to execute the query. Error code...
3
by: satishknight | last post by:
Hi, Can some one tell me how to change the validation sequence for the code pasted below, actually what I want it when any one enters the wrong login information (already registered users) then it...
2
by: nirav11 | last post by:
# include <iostream> # include <fstream> # include <iomanip> # include <cstdlib> // needed for exit () using namespace std; int main() { ifstream inFile; ofstream outFile;
9
by: happyse27 | last post by:
Hi All, In perl script(item b below) where we check if html registration form are filled in properly without blank with the necessary fields, how to prompt users that the field are incomplete...
6
mideastgirl
by: mideastgirl | last post by:
YIKES! I am having problems going from mideasthonors.org/addmember.php to either the error page because the form has not been filled out accurately, or to the thank you page!!!! Here is my script,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
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...

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.