4 messages in com.mysql.lists.win32problem with VBscript and ADO| From | Sent On | Attachments |
|---|---|---|
| Paul Heinrich | 25 Feb 2004 12:07 | |
| Thor812 | 25 Feb 2004 12:38 | |
| Randy Clamons | 25 Feb 2004 13:54 | |
| paul...@npgcable.com | 25 Feb 2004 17:08 |
| Subject: | problem with VBscript and ADO![]() |
|---|---|
| From: | Paul Heinrich (Paul...@NAU.EDU) |
| Date: | 02/25/2004 12:07:06 PM |
| List: | com.mysql.lists.win32 |
Hello,
I'm just beginning to write ASP pages to talk to a MySQL server. It's been going quite well. I'm able to Select, Insert, Delete and Update records via simple ASP pages. The problem come when I try to use the count(*) function in a SELECT statement in a VB statement with ADO. The code I'm using doesn't generate any VBscript or ASP error, but it also doesn't seem to return any value. Whne I send the SQL statement to the database using MySQL Control Center, the statement works fine and returns the proper value. Am I missing something basic here? The example code is below. Thank you, Paul
<!-- #INCLUDE file="database.inc" --> <%
on error resume next
dim adoConn
dim adoRS
dim strQuery
set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open "Driver=" & dbDriver & "; Database=" & dbDatabase & "; Uid=" & dbUser & ";Pwd=******;"
if adoConn.errors.count = 0 then
response.write "Connected Successfully!"
end if
countsql = "select count(*) from cite;" set numcites = adoConn.Execute(countsql)
response.write "value for numcites = " & numcites &" " response.write "<br>"
%>
-- Paul Heinrich Resource Lab Coordinator Merriam-Powell Center for Environmental Research Northern Arizona University 928-523-1939 Paul...@nau.edu




