Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
regarding connection string
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Good evening

How do we get the connection string?
i understand that in order to retrieve data from a database, we have to establish a connection string. but how do we get it.
For the sample application, the database is MS access. but in real time we do not always get MS Access.

So how do we obtain the connection string for different databases. i have sql server 2005 installed.
can you please explain ?

Thank you so much
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,

This might be useful to you.

Code:
Function GetDataFromBase(DNS,UID,PWD,QUERY)

    Set MyConnection = CreateObject("ADODB.Connection")
    Set myrecordset = CreateObject("ADODB.recordset")

    MyConnection.ConnectionString ="DSN=" & DNS  & "; UID=" & UID & ";PWD=" & PWD

    MyConnection.Open
    Set myrecordset = MyConnection.Execute(QUERY)
    GetDataFromBase = myrecordset(0)
    MyConnection.Close

End Function


Regards,
Sankalp
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Please check the below url for connection string
http://www.connectionstrings.com/sql-server-2005
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [UFT] Connection String for Oracle robertosalemi 6 12,297 01-15-2016, 04:51 PM
Last Post: robertosalemi
  DB2 Connect connection with IE 11 SRP 1 2,621 12-18-2015, 12:41 PM
Last Post: vinod123
  IBM DB2 connection with VB script bmurali 2 10,917 12-18-2015, 12:38 PM
Last Post: vinod123
  Connection with HP ALM hachem 0 2,626 02-26-2015, 04:36 PM
Last Post: hachem
  “Cannot connect to 8822 (connection timed out)" Ikbal 0 2,139 12-08-2014, 11:38 PM
Last Post: Ikbal

Forum Jump:


Users browsing this thread: 2 Guest(s)