dominicosavio
09-02-2002, 10:58 AM
Don't know what wrong with this code. Please help
set rs= Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = connString
rs.Source = "SELECT COUNT(ID) AS Total FROM mTABLE"
rs.Open()
Dim vTotal
vTotal = rs.fields.item("Total")
Dim vRandom
Randomize
vRandom = Int((vTotal * Rnd) + 1)
rs.Close()
rs.Source = "SELECT Source, Quote FROM mTABLE WHERE ID = '" + vRandom + "'"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open()
connString is defined in an include, and here is the error
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "SELECT Source, Quote"]'
Thank you
set rs= Server.CreateObject("ADODB.Recordset")
rs.ActiveConnection = connString
rs.Source = "SELECT COUNT(ID) AS Total FROM mTABLE"
rs.Open()
Dim vTotal
vTotal = rs.fields.item("Total")
Dim vRandom
Randomize
vRandom = Int((vTotal * Rnd) + 1)
rs.Close()
rs.Source = "SELECT Source, Quote FROM mTABLE WHERE ID = '" + vRandom + "'"
rs.CursorType = 0
rs.CursorLocation = 2
rs.LockType = 3
rs.Open()
connString is defined in an include, and here is the error
Microsoft VBScript runtime (0x800A000D)
Type mismatch: '[string: "SELECT Source, Quote"]'
Thank you