Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
regarding connection string
#1
Solved: 10 Years, 8 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: 10 Years, 8 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: 10 Years, 8 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 11,707 01-15-2016, 04:51 PM
Last Post: robertosalemi
  DB2 Connect connection with IE 11 SRP 1 2,405 12-18-2015, 12:41 PM
Last Post: vinod123
  IBM DB2 connection with VB script bmurali 2 10,423 12-18-2015, 12:38 PM
Last Post: vinod123
  Connection with HP ALM hachem 0 2,404 02-26-2015, 04:36 PM
Last Post: hachem
  “Cannot connect to 8822 (connection timed out)" Ikbal 0 1,990 12-08-2014, 11:38 PM
Last Post: Ikbal

Forum Jump:


Users browsing this thread: 1 Guest(s)