Forums

This topic is locked

identifying a varaible

Posted 30 Apr 2004 21:30:11
1
has voted
30 Apr 2004 21:30:11 pits sasa posted:
Hi

You know how dreamweaver allows you to create an database insert page. Dreamweaver then builds the insert statement and uses the variables from an array.

example MM_fieldsStr = Server_Name_ID|value|Logical_srvr_Name|value|CatID|value|.......

I want to use the variable Server_Name_ID to further do an update after the insert is done. In the update i want to use the primary key Server_Name_ID along with

OnlineUserIp = Request.ServerVariables("REMOTE_ADDR"
logon = Request.ServerVariables ("LOGON_USER" to capture audit info.

Can i use the Server_name_id field as a variable in the update statement following the insert
Please help..

Thanks

Replies

Replied 01 May 2004 12:52:48
01 May 2004 12:52:48 Vince Baker replied:
Yes, if you add the insert condition to this page then you can use that variable.

However, you cannot use the insert server behaviour, you will have to add a hand coded insert action.

if you need an example of that post back.

Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 02 May 2004 00:08:24
02 May 2004 00:08:24 pits sasa replied:
Will be great if you can put an example of that. Thanks in advance
Replied 02 May 2004 15:02:45
02 May 2004 15:02:45 Vince Baker replied:
Here is a typical insert action that will run when the page loads. Just change the name of fields, variables, table names and dont forget your connection name.


<%
sql_stats ="INSERT INTO tbl_stats (stat_user_id_fk, stat_url) VALUES (" & strStatUser & ",'" & strStatURL & "')"
%>

<%
set InsertStats = Server.CreateObject("ADODB.Command"
InsertStats.ActiveConnection = YOUR_CONNECTION
InsertStats.CommandText = sql_stats
InsertStats.CommandType = 1
InsertStats.CommandTimeout = 0
InsertStats.Prepared = true
InsertStats.Execute()
%>


Regards
Vince

Visit my home: www.chez-vince.com

VBScript | ASP | HTML | SQL | Oracle | Hosting

Reply to this topic