codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  INSERT INTO problems  Roooss at 20:52 on Tuesday, December 09, 2003
 

can anyone help me? i have set up a 'sigup' page partly using dreamweaver and i have hit a block, no matter what i do i cant INSERT INTO the database i've checked all the code and it seems to me to be correct, perhaps im missing something...




<!--#include file="/Connections/conn2.html" -->
<%
Dim val1
If(Request("UserID") <> "") then val1 = Request("UserID") else response.redirect("somedata.asp")
If(Request("Password") <> "") = (Request("Password2") <> "") then val2 = Request("Password") else response.redirect("somedata.asp")
If(Request("Firstname") <> "") then val3 = Request("Firstname") else response.redirect("somedata.asp")
If(Request("Surname") <> "") then val4 = Request("Surname") else response.redirect("somedata.asp")
If(Request("Email") <> "") then val5 = Request("Email") else response.redirect("somedata.asp")
If(Request("Website") <> "") then val6 = Request("Website") else response.redirect("somedata.asp")
If(Request("Postcode") <> "") then val7 = Request("Postcode") else response.redirect("somedata.asp")
If(Request("Street") <> "") then val8 = Request("Street") else response.redirect("somedata.asp")
If(Request("Country") <> "") then val9 = Request("Country") else response.redirect("somedata.asp")
If(Request("Mobile") <> "") then val10 = Request("Mobile") else response.redirect("somedata.asp")

set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn2_STRING
Recordset1.Source = "SELECT * FROM tblUsers"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>

<%
MM_connString = ("('" & Val1 & "','" & Val2 & "','" & Val3 & "','" & Val4 & "','" & Val5& "','" & Val6 & "','" & Val7 & "','" & Val8 & "','" & Val9 & "','" & Val10 & "')" )


set Command1 = Server.CreateObject("ADODB.Command")
Command1.ActiveConnection = MM_conn2_STRING
Command1.CommandText = "INSERT INTO tblUsers (UserID, Password, Firstname, Surname, Email, Website, Postcode, Street, Country, Mobile) VALUES " & MM_connString
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()


%>

<%
Recordset1.Close()
%>








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: onload event
•  Active Widgets
•  Re: onmouseover change image and text
•  Line Printer Interface
•  import contacts of msn/yahoo
•  Call windows apps from web apps
•  Re: ASP.NET web controls
•  netscape 6 browser problem
•  Re: Print .doc file from the website using System.Diagnostics.Process


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005