472,138 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

help needed - how to redirect based on form variable

2
Hi,

I have the following script which processes the html form and inserts into 3 tables. How can I pass the value of the variable EDSID to the next page using response.redirect?

Been trying to crack this for a while and it's doing my head in, any help would be appreciated.

Cheers,

<%
' Declaring variables
Dim EDSID, FirstName, data_source, con, sql_insert, sql_insert2, sql_insert3

' A Function to check if some field entered by user is empty
Function ChkString(string)
If string = "" Then string = " "
ChkString = Replace(string, "'", "''")
End Function

' Receiving values from Form
EDSID = ChkString(Request.Form("EDSID"))
FirstName = ChkString(Request.Form("FirstName"))
data_source = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=**********.mdb;" & "Persist Security Info=False"
sql_insert = "insert into CREDITORS (EDSID) values ('" & _
EDSID & "')"
sql_insert2 = "insert into CALLS (EDSID) values ('" & _
EDSID & "')"
sql_insert3 = "insert into DEBT (EDSID, FirstName) values ('" & _
EDSID & "', '" & FirstName & "')"

' Creating Connection Object and opening the database
Set con = Server.CreateObject("ADODB.Connection")
con.Open data_source
con.Execute sql_insert
con.Execute sql_insert2
con.Execute sql_insert3

' Done. Close the connection
con.Close
Set con = Nothing

Response.Redirect = "statement.asp?EDSID=ChkString(Request.Form("EDSID "))"
%>
Mar 5 '07 #1
2 1551
lm247
2
Solved it with:

<%
Response.redirect "statement.asp?EDSID=" & CStr(Request.form("EDSID")) & ""
%>
Mar 5 '07 #2
iam_clint
1,208 Expert 1GB
good job sorry i didn't get around to your post before you fixed it but atleast its fixed.
Mar 5 '07 #3

Post your reply

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

Similar topics

2 posts views Thread by Bobby | last post: by
2 posts views Thread by Jeremy | last post: by
8 posts views Thread by Andreas Klemt | last post: by
1 post views Thread by treelife | last post: by
reply views Thread by leo001 | last post: by

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.