sirarfalot
11-07-2003, 10:45 AM
Ok, Ive got a form called newband.asp. the fields in that are:
Genre,BandName,URL, influence1,influence2,influence3,influence4, address, email, country, bio.
The database is MS SQL.
Ive written an insert script in asp: called addband.asp
<%
'Gather variables from submitted page
Dim strGenre, strbandname, strURL, strinfluence1, strinfluence2, strinfluence3, strinfluence4, straddy1, strCountry, streaddy1, strbandinfo
strGenre = Request.Form("Genre")
strbandname = Request.Form("bandname")
strURL = Request.Form("URL")
strinfluence1 = Request.Form("influence1")
strinfluence2 = Request.Form("influence2")
strinfluence3 = Request.Form("influence3")
strinfluence4 = Request.Form("influence4")
straddy1 = Request.Form("addy1")
strCountry = Request.Form("Country")
streaddy1 = Request.Form("eaddy1")
strbandinfo = Request.Form("bandinfo")
'Create INSERT statement
'You may need to change the columns in the statement below to match the columns in your table
Dim strSQL, objConn, objCmd
strSQL = "INSERT INTO desabells(Genre, bandname, URL, influence1, influence2, influence3, influence4, addy1, Country, eaddy1, bandinfo) VALUES ("
strSQL = strSQL & "'" & Replace(strGenre,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strBandName,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strURL,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strInfluences1,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strInfluences2,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strInfluences3,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strInfluences4,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strAddress,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strCountry,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strEmail,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strBio,"'","''") & "')"
Dim oConn
Set oConn = Server.CreateObject( "ADODB.Connection" )
oConn.Open "Provider=MSDataShape;" & _
"Data Provider=SQLOLEDB;" & _
"Data Source=JASON;" & _
"Initial Catalog=desabells;" & _
"User ID=JasonMorjaria;" & _
"Password=bubble"
'Create Command Object
Set objCmd = Server.CreateObject("ADODB.Command")
objCmd.ActiveConnection = oConn
objCmd.CommandText = strSQL
'objCmd.Execute
'Remove variables
Set objCmd = nothing
Set objConn = nothing
Response.Redirect "redirect.asp?Bandname=" & request("Bandname") & "&email=" & request("email")
%>
I cannot get the page to work for some reason???????
the error is:
Page cannot be found.
Not sure why?
the page is there. The server is asp enabled, its abyss. Will I need IIS for this script to work.
I dont really know which of my scripts need IIS as I dont have it and am not sure if its a fault in my code or a lack of IIS.
Any help would be appreciated.
thanks
Genre,BandName,URL, influence1,influence2,influence3,influence4, address, email, country, bio.
The database is MS SQL.
Ive written an insert script in asp: called addband.asp
<%
'Gather variables from submitted page
Dim strGenre, strbandname, strURL, strinfluence1, strinfluence2, strinfluence3, strinfluence4, straddy1, strCountry, streaddy1, strbandinfo
strGenre = Request.Form("Genre")
strbandname = Request.Form("bandname")
strURL = Request.Form("URL")
strinfluence1 = Request.Form("influence1")
strinfluence2 = Request.Form("influence2")
strinfluence3 = Request.Form("influence3")
strinfluence4 = Request.Form("influence4")
straddy1 = Request.Form("addy1")
strCountry = Request.Form("Country")
streaddy1 = Request.Form("eaddy1")
strbandinfo = Request.Form("bandinfo")
'Create INSERT statement
'You may need to change the columns in the statement below to match the columns in your table
Dim strSQL, objConn, objCmd
strSQL = "INSERT INTO desabells(Genre, bandname, URL, influence1, influence2, influence3, influence4, addy1, Country, eaddy1, bandinfo) VALUES ("
strSQL = strSQL & "'" & Replace(strGenre,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strBandName,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strURL,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strInfluences1,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strInfluences2,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strInfluences3,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strInfluences4,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strAddress,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strCountry,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strEmail,"'","''") & "',"
strSQL = strSQL & "'" & Replace(strBio,"'","''") & "')"
Dim oConn
Set oConn = Server.CreateObject( "ADODB.Connection" )
oConn.Open "Provider=MSDataShape;" & _
"Data Provider=SQLOLEDB;" & _
"Data Source=JASON;" & _
"Initial Catalog=desabells;" & _
"User ID=JasonMorjaria;" & _
"Password=bubble"
'Create Command Object
Set objCmd = Server.CreateObject("ADODB.Command")
objCmd.ActiveConnection = oConn
objCmd.CommandText = strSQL
'objCmd.Execute
'Remove variables
Set objCmd = nothing
Set objConn = nothing
Response.Redirect "redirect.asp?Bandname=" & request("Bandname") & "&email=" & request("email")
%>
I cannot get the page to work for some reason???????
the error is:
Page cannot be found.
Not sure why?
the page is there. The server is asp enabled, its abyss. Will I need IIS for this script to work.
I dont really know which of my scripts need IIS as I dont have it and am not sure if its a fault in my code or a lack of IIS.
Any help would be appreciated.
thanks