<i><b>Originally posted by : Tony (webmaster@gratis4free.com)</b></i><br />Hi,<br /> I'd be very grateful if someone could give me a bit of help. I need to get a stored procedure to do a search in a Sql database and then return the recordcount. Can anyone help me please? <br /><br />I thankyou in advance for any help you can give me.
<i><b>Originally posted by : Mike B (mikeb811@hotmail.com)</b></i><br />set objCmd = Server.CreateObject("ADODB.Command")<br /><br />'For DSN-Less connection<br />'driv = "Provider=Microsoft.Jet.OLEDB.4.0;"<br />'datasource = "Data Source=your db name goes here;"<br />'conn.Open driv & datasource<br /> <br /> OR <br /><br />'For DSN conenctions<br />DSN_Name="your DNS name goes here"<br />conn.Open DSN_Name<br /><br />strSQL = "SELECT * from courses;"<br />objCmd.CommandText = "name of stored procedure"<br />objCmd.CommandType = adCmdStoredProc<br />objCmd.ActiveConnection = conn<br />set rscnt = objCmd.execute()<br /><br />This leaves query results in recorset rscnt.<br /><br />Hope this helps<br /><br />Mike<br /><br />------------<br />Tony at 4/7/2000 5:14:07 AM<br /><br />Hi,<br /> I'd be very grateful if someone could give me a bit of help. I need to get a stored procedure to do a search in a Sql database and then return the recordcount. Can anyone help me please? <br /><br />I thankyou in advance for any help you can give me.
Was this answer helpful ?
Yes No
<i><b>Originally posted by : Aj (ajay@aimpro.co.uk)</b></i><br />How can I use this mechanism to write search engine. Remember that in the input box, pleeple can type more than one word?<br /><br /><br /><br />------------<br />Mike B at 4/10/2000 1:25:52 PM<br /><br />set objCmd = Server.CreateObject("ADODB.Command")<br /><br />'For DSN-Less connection<br />'driv = "Provider=Microsoft.Jet.OLEDB.4.0;"<br />'datasource = "Data Source=your db name goes here;"<br />'conn.Open driv & datasource<br /> <br /> OR <br /><br />'For DSN conenctions<br />DSN_Name="your DNS name goes here"<br />conn.Open DSN_Name<br /><br />strSQL = "SELECT * from courses;"<br />objCmd.CommandText = "name of stored procedure"<br />objCmd.CommandType = adCmdStoredProc<br />objCmd.ActiveConnection = conn<br />set rscnt = objCmd.execute()<br /><br />This leaves query results in recorset rscnt.<br /><br />Hope this helps<br /><br />Mike<br /><br />------------<br />Tony at 4/7/2000 5:14:07 AM<br /><br />Hi,<br /> I'd be very grateful if someone could give me a bit of help. I need to get a stored procedure to do a search in a Sql database and then return the recordcount. Can anyone help me please? <br /><br />I thankyou in advance for any help you can give me.
Was this answer helpful ?
Yes No