|
-
Oct 3rd, 2000, 12:57 PM
#1
Hi there...... I'm starting to wonder if it is actually possible to establish a connection with my database from within a sub function. I've tried several ways but I don't seem able to get it to work. Here's what I've tried:
SUB GetRecords()
set DBObj = server.createobject("ADODB.connection")
DBObj.open "TaskManager", adOpenKeyset
sql = "SELECT M, J, FROM mytable WHERE M = '" &Choosen& "'"
RS = DBObj.execute(sql)
DBObj.close
END SUB
SUB Detect_Option()
If Detected.options(Detected.SelectedIndex).value="October" THEN
Choosen = "October"
GetRecords()
else
Choosen = "November"
GetRecords()
End If
END SUB
The same connection is done initially at the top of my page with a specific Field name instead of the variable "&Choosen&" and there's absolutely no problem there. But if I try to reaccess the databse from within my page with a sub function I've notice that it just doesn't execute the connectivity statements. Please send your recomendation. Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|