Forums
This topic is locked
Passing URL parameter
Posted 28 Jun 2005 09:43:27
1
has voted
28 Jun 2005 09:43:27 Mark Meerten posted:
Hello,I made an asp page to insert a record to a SQL DB. The server behavior "insert record" has an option "After inserting, Go To:"
I entered another asp page and clicked on the "Parameters" button. I entered the parameter's name and a value of the recordset.
This other page uses the URL parameter to build a new recorset.
The code generated by dreamweaver is the folowing:
<i>MM_editRedirectUrl = "/personeel/verlof_bevestiging.asp?persnr=" + (rsVerlof.Fields.Item("Tpers_nr".Value) + ""</i>
When i test the application i get the following fault:
<i>"Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near 'Tpers_nr'.
/personeel/verlof_bevestiging.asp, line 20"</i>
I think this is caused by the messed up URL. It looks like this:
<i>localhost/personeel/verlof_bevestiging.asp?persnr=%22%20%2B%20(rsVerlof.Fields.Item(%22Tpers_nr%22).Value)%20%2B%20%22</i>
What's wrong? I presumed that the code wich is generated by DW is always correct?
When i delete the +"" at the end of the line i'm still getting an error:
<i> Microsoft VBScript runtime error '800a01a8'
Object required: ''
/personeel/verlof.asp, line 46
</i>
2B|!2B
Replies
Replied 29 Jun 2005 16:13:23
29 Jun 2005 16:13:23 adam partridge replied:
is your recordset call higher in the page than your redirect/insert code ?
Replied 29 Jun 2005 16:20:01
29 Jun 2005 16:20:01 adam partridge replied:
acutally lookin at it i think its a qutoes problem try
MM_editRedirectUrl = "/personeel/verlof_bevestiging.asp?persnr=" & rsVerlof.Fields.Item("Tpers_nr".Value
MM_editRedirectUrl = "/personeel/verlof_bevestiging.asp?persnr=" & rsVerlof.Fields.Item("Tpers_nr".Value
Replied 12 May 2006 16:10:40
12 May 2006 16:10:40 simon best replied: