When I am initially starting coding, I like to check if the connection is
good.

if cn.state 1 then
  msgbox "there is a connection"
else
  msgbox "connection failed"
end if

I also use DS-less connection so that the code will be more universal.
http://www.accessmvp.com/djsteele/DSNLessLinks.html
The following has the best set of DSN


On Thu, Jul 7, 2011 at 8:35 AM, Tirumalesh <[email protected]>wrote:

>
> Dim cn,rs
> Set cn = CreateObject ("ADODB.Connection")
> Set rs = CreateObject ("ADODB.Recordset")
> cn.Open "DSN = QT_Flight32"
> rs.Open "select * from employee ", cn
>
> While rs.EOF <>True
>        print rs("I_name")&" "& rs("f_name")
>        rs.MoveNext
> Wend
>
> rs.Close
> cn.Close
>
> it through Error
> The test run cannot continue due to an unrecoverable error.
>
> [Microsoft][ODBC Driver Manager] Data source name not found and no
> default driver specified
>
> Line (1): "".
>
> --
> 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