HighDots Forums  

recordsets in DMX

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss recordsets in DMX in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
-D-
 
Posts: n/a

Default recordsets in DMX - 08-01-2004 , 11:17 AM






I'm trying to get procient with the DMX recordsets advanced interface. I'm
trying to accomplish the following. Here is the code written by hand:

<%

Dim objConn

Set objConn = Server.CreateObject(“ADODB.Connection”)

ObjConn.Open “Provider = Microsoft.Jet.OLEDB.4.0; “ & _

“Data Source = E:\ WroxClassifieds_site\Classified.mdb;Persist Security
Info=False"



If Session("blnValidUser") = True and Session("PersonID") = "" Then

Dim rsPersonIDCheck

Set rsPersonIDCheck = Server.CreateObject("ADODB.Recordset")

Dim strSQL

strSQL = "SELECT PersonID FROM Person " & _

"WHERE EMailAddress = '" & Session("EMailAddress") & "';"

rsPersonIDCheck.Open strSQL, objConn

If rsPersonIDCheck.EOF Then

Session("blnValidUser") = False

Else

Session("PersonID") = rsPersonIDCheck("PersonID")

End If

rsPersonIDCheck.Close

Set. rsPersonIDCheck = Nothing

End If

%>



Plugging the code from above into DMX doesn't display the recordset. I'm
trying to learn to use DMX to write the same code as above.



Here is what I have been trying within DMX as a start and the code that DMX
generates:

(I'm using a include file for the connection to the DB, which works fine).



<!--#include file="Connections/DBConn.asp" -->

<%

Dim rsPersonIDCheck__MMColParam

rsPersonIDCheck__MMColParam = "1"

If (Session("EmailAddress") <> "") Then

rsPersonIDCheck__MMColParam = Session("EmailAddress")

End If

%>

<%

Dim rsPersonIDCheck

Dim rsPersonIDCheck_numRows



Set rsPersonIDCheck = Server.CreateObject("ADODB.Recordset")

rsPersonIDCheck.ActiveConnection = MM_DBConn_STRING

rsPersonIDCheck.Source = "SELECT PersonID FROM Person WHERE EmailAddress =
'" + Replace(rsPersonIDCheck__MMColParam, "'", "''") + "'"

rsPersonIDCheck.CursorType = 0

rsPersonIDCheck.CursorLocation = 2

rsPersonIDCheck.LockType = 1

rsPersonIDCheck.Open()



rsPersonIDCheck_numRows = 0

%>

<%

rsPersonIDCheck.Close()

Set rsPersonIDCheck = Nothing

%>

So, can anyone offer some help in how to go about generating the code in top
example into the proper code within DMX? In a nutshell, I'm trying to get
where I can use DMX to generate the proper code for me instead of
handcoding, but I'm not quite understanding the interface in DMX and how it
creates the code. Thanks for any help.
-D-



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.