473,396 Members | 1,784 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Looking for ADO statement for SQL Database

I have a database in SQL2K and I want to write a small program in VB6.

Once I create program in VB6, it should work from any client's computer.

My SQL database is sitting on share drive X on the w2k server. My sql2k
server name is MYSERVER, my database name is MYDATABASE and table name is
MYTABLE.

I do not want to set up ODBC connection on each computer. I want to set up
in the program so I do not have to go thru each computer each time I write
any program.

Thanks.
Jul 17 '05 #1
2 4528

"news.verizon.net" <ma*@hotmail.com> wrote in message
news:ip*****************@nwrddc01.gnilink.net...
I have a database in SQL2K and I want to write a small program in VB6.

Once I create program in VB6, it should work from any client's computer.
My SQL database is sitting on share drive X on the w2k server. My sql2k server name is MYSERVER, my database name is MYDATABASE and table name is MYTABLE.

I do not want to set up ODBC connection on each computer. I want to set up in the program so I do not have to go thru each computer each time I write any program.

Thanks.

Use ADO (Add a Reference to Microsoft ActiveX DataObjects).

The code will look vaguely like this. You will need to lookup the
various methods, check the parameters, and get the values right for your
particular setup.

Dim oConn as Connection
Dim oRecSet as Recordset

Set oConn = New Connection
Call oConn.Open ( "Provider=SQLOLEDB.1;Initial Catalog=mydatabase;Data
Source=MyServer", UserName, PW)

set oRecSet = New Recordset

call oRecSet.Open("SELECT RecID From tblSample", oConn, adOpenStatic,
adLockOptimistic)

You can use the Microsoft ADO Data Control to setup your first
connection, and get the connection string from it, although I would not
use the control itself in an application.

Hope this helps.

Steve
Jul 17 '05 #2
"news.verizon.net" <ma*@hotmail.com> wrote in message news:<ip*****************@nwrddc01.gnilink.net>...
I have a database in SQL2K and I want to write a small program in VB6.

Once I create program in VB6, it should work from any client's computer.

My SQL database is sitting on share drive X on the w2k server. My sql2k
server name is MYSERVER, my database name is MYDATABASE and table name is
MYTABLE.

I do not want to set up ODBC connection on each computer. I want to set up
in the program so I do not have to go thru each computer each time I write
any program.


create a UDL file and distribute that with your app and open your
connection using: connection.Open "file name=pathtotheuldfile;"

or just embed the connection string in your app
connection.open "Provider=SQLOLEDB.1;Data Source=MyServer...."
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Marco Aschwanden | last post by:
Hi I would like to develop an app that is (more or less) database independet. Python DB API helps when masking "parameters" of sql statements. The db driver cares for the correct conversion of a...
9
by: Ben | last post by:
I have two 'Do While Not' statements, that are getting information from the same recordset. If I comment out the first one I can get the results for the second one, and vice-versa. Why is this...
2
by: Little PussyCat | last post by:
Hello, I hope you can help me. We have a SQL Server 2000 database at work, (which works with a VB6 frontend) which grew to a considerable size, so one of my past colleagues sent me this...
6
by: David | last post by:
I am using ADO to run some SQL statements in Access. First, I run query to create a table using SELECT . . . INTO Table A. Then, I run a query to SELECT . . . FROM Table A to get some data and...
7
by: kosta | last post by:
hello! one of my forms communicates with a database, and is supposed to add a row to a table using an Insert statement... however, I get a 'oledb - syntax error' exception... I have double...
1
by: Johann Blake | last post by:
I am looking for a good solution on how to implement data access in an application so that there is a clean separation between the data access layer, the business layer and the GUI layer. I am...
1
by: Hayden Kirk | last post by:
Hey Guys, I have a wizard control which has 3 steps. First step is them entering their email address and then me verifying that it is either in the database or not. If it's not, then insert it,...
1
by: Randy Volkart | last post by:
I'm trying to fix a glitch in a complex access database, and have a fairly complex problem... unless there's some obscure easy fix I don't know being fairly new with Access. Basically, the area...
2
Haitashi
by: Haitashi | last post by:
I have a database that currently contains different albums. The way I had the database was that there is a "description" field in which I placed all the songs. When I access my site I see in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.