Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database connectivity error
#1
Solved: 10 Years, 9 Months, 2 Weeks ago
Hi,

While doing connectivity to database i am facing an issue..Firstly the script containing connectivity funcn was working.But i transfared that on new system and created the same DSN..
Now while running the script error that "Timeout expire" is getting populated..

connectivity function:
Code:
Function Connect_to_db(Byval mfgprt)

Dim cnn,rss
Set cnn = CreateObject("ADODB.Connection")
Set rss = CreateObject("ADODB.recordset")
cnn.ConnectionString = "DSN=QTPDSN;Description=desc;UID=sa;PWD=Passw0rd;APP=QuickTest Professional;WSID=.....;DATABASE=.....;"
cnn.open
rss = cnn.Execute("select  UnitPrice  from ------where MfPartNumber ='" + mfgprt + "'")
Connect_to_db=rss(0)
End Function

Could anyone suggest me the reason behind this....?

Thanks
Reply
#2
Solved: 10 Years, 9 Months, 2 Weeks ago
galstar -
You need to debug line by line to get to the bottom of the issue. Well here are a few pointers,

1. Check if the connection is established.
2. Execute the query manually to see if you get the results. Execute with the exact query you are using.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Solved: 10 Years, 9 Months, 2 Weeks ago
Yeah i got the reason...DB was not started..:-p
noe it is working fine...
Thanks for reply
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Database connection error learnasugo 3 3,905 05-15-2014, 01:49 PM
Last Post: Ankur
  Issue related to DB connectivity.. galstar 0 1,628 08-17-2010, 01:07 PM
Last Post: galstar
Exclamation DB Connectivity Priyanka Arya 5 3,898 08-10-2010, 01:47 PM
Last Post: QTPLearn
  How to write a script or database connectivity to connect oracle databse upadhyay40 10 7,845 11-24-2009, 12:37 PM
Last Post: Saket

Forum Jump:


Users browsing this thread: 1 Guest(s)