Johnnie100
Programmer
I am trying to connect to a database and return a recordset using the following code:
dim ReturnCount
'Define db connection variables
dim adoConn
dim sConn
dim strQuery
dim adoRsWebCrawler
'Create connection object
set adoConn =server.CreateObject("ADODB.Connection"
'Create connection string
sConn = ""
sConn = "Provider=SQLOLEDB.1;" & _
"Persist Security Info=False;" & _
"User ID= & _
"Password = & _
"Initial Catalog=mspyajj_WebCrawler;" & _
"Data Source=CSMS11"
'Open connection to database
adoConn.Open sConn
' get the records that match the keyword
set adoRsWebCrawler = Server.CreateObject("adodb.recordset"
strQuery = "SELECT URL, KEY1.rank " &_
"FROM CONTAINSTABLE(WebCrawlerImport, *, '(" &_
Request.form("keyword"
&_
"
')as KEY1 INNER JOIN WebCrawlerImport WI on WI.Count = KEY1.[key] ORDER BY KEY1.RANK DESC"
'Populate recordset
adoRsWebCrawler.Open strQuery, adoConn, 3
ReturnCount = adoRsWebCrawler.RecordCount
--BUT I get the following error - I have spent over an hour trying to figure out what the error code means but MSDN isn't very helpful. I can run the query in ISQLW so don't think that is the problem.
The thing is I'm using exactly the same connection string to connect to the db to write away my records in the first place. Does the fact that I'm using a table with a full text index populated on it have any bearing??
I'm getting the following error msg:
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/mspyajj/WebCrawlerSearchEngine/WebCrawlerSearchPage.asp, line 75
Thanks
dim ReturnCount
'Define db connection variables
dim adoConn
dim sConn
dim strQuery
dim adoRsWebCrawler
'Create connection object
set adoConn =server.CreateObject("ADODB.Connection"
'Create connection string
sConn = ""
sConn = "Provider=SQLOLEDB.1;" & _
"Persist Security Info=False;" & _
"User ID= & _
"Password = & _
"Initial Catalog=mspyajj_WebCrawler;" & _
"Data Source=CSMS11"
'Open connection to database
adoConn.Open sConn
' get the records that match the keyword
set adoRsWebCrawler = Server.CreateObject("adodb.recordset"
strQuery = "SELECT URL, KEY1.rank " &_
"FROM CONTAINSTABLE(WebCrawlerImport, *, '(" &_
Request.form("keyword"
"
'Populate recordset
adoRsWebCrawler.Open strQuery, adoConn, 3
ReturnCount = adoRsWebCrawler.RecordCount
--BUT I get the following error - I have spent over an hour trying to figure out what the error code means but MSDN isn't very helpful. I can run the query in ISQLW so don't think that is the problem.
The thing is I'm using exactly the same connection string to connect to the db to write away my records in the first place. Does the fact that I'm using a table with a full text index populated on it have any bearing??
I'm getting the following error msg:
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/mspyajj/WebCrawlerSearchEngine/WebCrawlerSearchPage.asp, line 75
Thanks