recordset.Open Source, ActiveConnection, CursorType, LockType, Options

I usually write:

db.open "dsn=" & Dsn_Name    ' I assume Dsn_Name is defined above
' you need to include the single quote around your number
strSQL = "select * from createtable where Test_case_id='" & TestCase & "'"
rs.open strSQL,db
' assume TestCase is defined above
' what cursortype and locktype are you using ?



On Fri, Apr 6, 2012 at 10:12 AM, Suresh Pandian <[email protected]>wrote:

> Hi all,
>
> I just ran a query to fetch records from the ms access database, i
> used variables for the condition
>
> Set db = CreateObject("ADODB.connection")
> Set rs = CreateObject("ADODB.recordset")
> db.connectionstring="dsn="&Dsn_Name
> db.open
>
> rs.open "select * from createtable where Test_case_id =" &TestCase,db
>
> this returns the below error.
>
> [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected
> 1.
> Function file: \.....\Library\common_functions.vbs
> Line (174): " rs.open "select * from Createnewuser where Test_case_id
> =" &TestCase,db".
>
> when i hardcode the value like rs.open "select * from createtable
> where Test_case_id = '5454'" ,db then i am getting the record
>
> Any help is appreciated.
>
> --
> You received this message because you are subscribed to the Google
> "QTP - HP Quick Test Professional - Automated Software Testing"
> group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/MercuryQTP?hl=en
>



-- 
Parke
Cell: 770-842-0121

-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to