Hi,
I've made a form and i want to send it with the post method.
Another asp file retreves the data and procesess it. The problem is in the beginning... I can't retreve the data. I think it has to do with the connection with the database. Could somebody look at it please?
This is the code, it dutch so don't be fooled if you thought it was drunk or something like that!
<%
' stap 0 variabelen aanmaken (hun scope = alleen in dit bestand)
dim cnDb
dim cmAddToDB
dim strInsertSQL
' Stap 3 Verbinding maken
set cnDB = Server.CreateObject("ADODB.Connection"
cnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("cnDB.open
' Stap 1 opvragen van velden
var_naam= Request.Form("naam"
var_naam= "'" & var_naam & "'"
var_adres= Request.Form("adres"
var_adres= "'" & var_adres & "'"
' Stap 2 SQL statement + Stap 1 opvragen van velden
strInsertSQL = "INSERT INTO kapvergunning(ondergetekende, adres) VALUES (" & var_naam & "," & var_adres & ""
' Stap 4 uitvoeren
set cmAddToDB = Server.CreateObject("ADODB.Command"
set cmAddToDB.ActiveConnection = cnDB
cmAddToDB.CommandText = strInsertSQL
cmAddToDB.Execute
' Stap 4B Alles weer legen
set cnDB = Nothing
set cmAddToDB = Nothing
%>
I'm using a personal webserver and my database is allso lokated in the ODBC system DSN.
Thank you in advance!
I've made a form and i want to send it with the post method.
Another asp file retreves the data and procesess it. The problem is in the beginning... I can't retreve the data. I think it has to do with the connection with the database. Could somebody look at it please?
This is the code, it dutch so don't be fooled if you thought it was drunk or something like that!
<%
' stap 0 variabelen aanmaken (hun scope = alleen in dit bestand)
dim cnDb
dim cmAddToDB
dim strInsertSQL
' Stap 3 Verbinding maken
set cnDB = Server.CreateObject("ADODB.Connection"
cnDB.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("cnDB.open
' Stap 1 opvragen van velden
var_naam= Request.Form("naam"
var_naam= "'" & var_naam & "'"
var_adres= Request.Form("adres"
var_adres= "'" & var_adres & "'"
' Stap 2 SQL statement + Stap 1 opvragen van velden
strInsertSQL = "INSERT INTO kapvergunning(ondergetekende, adres) VALUES (" & var_naam & "," & var_adres & ""
' Stap 4 uitvoeren
set cmAddToDB = Server.CreateObject("ADODB.Command"
set cmAddToDB.ActiveConnection = cnDB
cmAddToDB.CommandText = strInsertSQL
cmAddToDB.Execute
' Stap 4B Alles weer legen
set cnDB = Nothing
set cmAddToDB = Nothing
%>
I'm using a personal webserver and my database is allso lokated in the ODBC system DSN.
Thank you in advance!