W
What-a-Tool
What is the proper format for my SQL str using command.execute? Even though
I know I have matching data in my table, I keep coming up with a
..RecordCount of -1. What am I doing wrong?
Thanks in advance :
'Create a connection object
Set con = Server.CreateObject("ADODB.Connection")
Set rst = Server.CreateObject("ADODB.Recordset")
Set cmd = Server.CreateObject("ADODB.Command")
strSQL = "SELECT tblUI.IPAdd FROM tblUI WHERE (tblUI.IPAdd ='?')"
arSPrm = Array(strRemHst)
con.Provider = "Microsoft.Jet.OLEDB.4.0"
con.Open Server.MapPath("../dbs/vstr.mdb")
cmd.CommandType = 1
cmd.CommandText = strSQL
Set cmd.ActiveConnection = con
Set rst = cmd.Execute(,arSPrm)
I know I have matching data in my table, I keep coming up with a
..RecordCount of -1. What am I doing wrong?
Thanks in advance :
'Create a connection object
Set con = Server.CreateObject("ADODB.Connection")
Set rst = Server.CreateObject("ADODB.Recordset")
Set cmd = Server.CreateObject("ADODB.Command")
strSQL = "SELECT tblUI.IPAdd FROM tblUI WHERE (tblUI.IPAdd ='?')"
arSPrm = Array(strRemHst)
con.Provider = "Microsoft.Jet.OLEDB.4.0"
con.Open Server.MapPath("../dbs/vstr.mdb")
cmd.CommandType = 1
cmd.CommandText = strSQL
Set cmd.ActiveConnection = con
Set rst = cmd.Execute(,arSPrm)