Link to home
Start Free TrialLog in
Avatar of bisbeeper
bisbeeper

asked on

Want to learn basics on ado

Can u give me some clues on how i can build a connectionstring? It confuses me a lot! Just need something small that i can test on my pc.

And something else: SQL Server, ODBC etc what exactly are? How they are installed? Are they already installed????

Thank u
Avatar of Dave_Greene
Dave_Greene

Here is a good site for all kinds of connection strings

http://www.able-consulting.com/ADO_Conn.htm

For Standard Security:

oConn.Open "Driver={SQL Server};" & _
                   "Server=MyServerName;" & _
                   "Database=myDatabaseName;" & _
                   "Uid=myUsername;" & _
                   "Pwd=myPassword;"

For Trusted Connection security:

oConn.Open "Driver={SQL Server};" & _
                   "Server=MyServerName;" & _
                   "Database=myDatabaseName;" & _
                   "Uid=;" & _
                   "Pwd=;"

' or

oConn.Open "Driver={SQL Server};" & _
                   "Server=MyServerName;" & _
                   "Database=myDatabaseName;" & _
                   "Trusted_Connection=yes;"

To Prompt user for username and password

oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Driver={SQL Server};" & _
                   "Server=MyServerName;" & _
                   "DataBase=myDatabaseName;"

> Can u give me some clues on how i can build a connectionstring? It confuses me a lot! Just need something
small that i can test on my pc.

check out:
http://www.able-consulting.com/ADO_Conn.htm

> And something else: SQL Server, ODBC etc what exactly are? How they are installed? Are they already
installed????

SQL Server is a relational database, no it is not already installed:
get it here:
http://www.microsoft.com/sql/downloads/default.asp


ODBC:
ODBC
Home |  Overview |  How Do I |  FAQ |  Sample |  Tutorial |  ODBC Driver List

In addition to an overview of Open Database Connectivity (ODBC), this article explains:

How ODBC works with the database classes.


How ODBC drivers work with dynasets.


What ODBC components you need to redistribute with your applications.
You will also want to read the related article ODBC: The ODBC Cursor Library.

Notes   ODBC data sources are accessible through the MFC ODBC classes, as described in this article, or through the MFC Data Access Object (DAO) classes. For information about the DAO classes, see the article DAO and MFC.

The MFC ODBC classes support Unicode and multithreading. For more information about the multithreading support, see the article ODBC Classes and Threads

ODBC is a call-level interface that allows applications to access data in any database for which there is an ODBC driver. Using ODBC, you can create database applications with access to any database for which your end-user has an ODBC driver. ODBC provides an API that allows your application to be independent of the source database management system (DBMS).

ODBC is the database portion of the Microsoft Windows Open Services Architecture (WOSA), an interface which allows Windows-based desktop applications to connect to multiple computing environments without rewriting the application for each platform.

The following are components of ODBC:

ODBC API
A library of function calls, a set of error codes, and a standard Structured Query Language (SQL) syntax for accessing data on DBMSs.

ODBC Driver Manager
A dynamic-link library (ODBC32.DLL) that loads ODBC database drivers on behalf of an application. This DLL is transparent to your application.

ODBC database drivers
One or more DLLs that process ODBC function calls for specific DBMSs. For a list of supplied drivers, see the article ODBC Driver List.

ODBC Cursor Library
A dynamic-link library (ODBCCR32.DLL) that resides between the ODBC Driver Manager and the drivers and handles scrolling through the data.

ODBC Administrator
A tool used for configuring a DBMS to make it available as a data source for an application.

An application achieves independence from DBMSs by working through an ODBC driver written specifically for a DBMS rather than working directly with the DBMS. The driver translates the calls into commands its DBMS can use, simplifying the developer?s work, and making it available for a wide range of data sources.

The database classes support any data source for which you have an ODBC driver. This might, for example, include a relational database, an Indexed Sequential Access Method (ISAM) database, a Microsoft Excel spreadsheet, or a text file. The ODBC drivers manage the connections to the data source, and SQL is used to select records from the database.

See the article ODBC Driver List for a list of ODBC drivers included in this version of Visual C++ and for information about obtaining additional drivers.

The ODBC Software Development Kit (SDK) is provided on the MSDN Library CD. For more information on ODBC, see the ODBC SDK Programmer?s Reference, and the ODBC API Reference Help




Windows comes standard with odbc drivers installed.  You may want to upgrade to newer drivers to have the latest and greatest.  You will need MDACTYP(ver).exe  I'll see if I can find the link for you...
Here is that link if you want to upgrade you ODBC files

http://www.microsoft.com/data/download.htm
Avatar of bisbeeper

ASKER

Thank u all ppl, u are really amazing. I didn't get the part "myservername" by dave, what server do you mean? And what do you earn by points? This is my first q! Can i possibly split the points?
Oh, i'm quite lost in the link, too much software.
> I didn't get the part "myservername" by dave
when you install sql server, "myservername" will be the name of the computer you installed it on.

> And what do you earn by points?
Not much... ;)

> This is my first q! Can i possibly split the points?
Sure can, post a question in community support and let them know that is what you wish to do.

good luck!
Thank u all ppl, u are really amazing. I didn't get the part "myservername" by dave, what server do you mean? And what do you earn by points? This is my first q! Can i possibly split the points?
Oh, i'm quite lost in the link, too much software.
<<I didn't get the part "myservername">>

This would be your DB Server.  IF you are running it on your development machine you can leave that parameter out

<<And what do you earn by points?>>
Nothing really, a t-shirt if you're lucky.  Most people just do it to help others  :)
Thank u all ppl, u are really amazing. I didn't get the part "myservername" by dave, what server do you mean? And what do you earn by points? This is my first q! Can i possibly split the points?
Oh, i'm quite lost in the link, too much software.
lol... it posted my comment 3 times! thank u again, i will throw a coin for the points, to be fair. Ok, it's dave, hurray!! God bless u guys
Jim
ASKER CERTIFIED SOLUTION
Avatar of Dave_Greene
Dave_Greene

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
>i will throw a coin for the points, to be fair.

lol, that's a first... congrats dave! ;)
Thanks bobbit31, I guess I'll go out and get a lottery ticket... and pray my luck holds up  :)