ODBC Connection
Iam trying to connect from VB to Oracle8.i using Microsoft ODBC Driver for Oracle.What are the pre-requisites for connecting without DSN with ADO or RDO?I have Oracle Server at my local machine , do i need to have Oracle Client installed also.Please elaborate.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Make Connection Per ODBC (Connection + Command)
I try to connect my VB-programm by using an Environmentpage. I make (and test) a connection by ODBC. The connection is succesfull.
After that I make a connection to a table, by using a command.
From this command I put some fields on my Form.
When I start my programm, after putting the fields on my form, I get the following message;
'Unable to bind to field or datamember ; .....'
When I make the same connection in MS-Access, it succeed....
How can this happen and how can I solve my little problem????
ODBC Connection
I was told that I could use the Data Source ODBC connection to connect my vb program to an access database which is stored at this address...
www.dapaine.com/consultation.mdb
How can I connect this? and what code to i use when connecting? thanks a lot!
ODBC Asking For The Connection ...
I've set up an ODBC connection (using the Wizard) and linked to SQL Servor tables at a different site.
I can open the tables with no problem but when I try to write queries, a diaglog box (standard MS, not related to the SQL Site) pops up asking for the source of the data. The data source is displayed and all I have to do is click the data name and everything works.
Unfortunately, I don't want to have to click the data source each time ... kinda defeats the purpose of having a macro.
What am I doing wrong, or (more likely) what HAVEN'T I done?
ODBC Connection
I need help with creating an ODBC connection from VB to MS Access 2003. Can anyone please point me in the right direction. I've seen bits and pieces of code but I would like to see the whole picture. Thank you in advance.
Set Up ODBC Connection
IN access97 (or VB5) how do I create a connection to an ODBC???
Bascially I need to set up a connection to a DB on a sql server...then verify the name.
Our server will default to a certain DB if you try to connect to a non-existant DB.
thanks!
ODBC Connection
Hi,
I'm connecting with a dial-up from a PC with Win98 SE to a some kind of an "access point" PC which is accepting an incoming connections. I want to make an ODBC connection to a SQL Server which resides on a same network with an "access point" PC. But, allways I get an error creating an ODBC as follows:
Connection Failed
SQL State:'HTY00'
SQL Server Error:0
[Microsoft][ODBC SQL Server Driver] Timeout expired
When I try to do the same thing from a PC running Win ME or higher there is no problem. What is the problem with the Win98 SE connections? Please help.
Nikola
P.S. After establishing of the dial-up connection I can ping an "access point" PC and also a SQL Server PC.
ODBC Connection
Hi
I want to know how to set up an ODBC connection in VB
All my setup in the Data Source Administrator are done..
but How I code this??
an ODBC newbie who wants help.... thanks
NDS ODBC Connection
I just got the Netware NDS ODBC connection configured and am beginning to muck around with it. The problem that I see with it is that is pulls sooooo much data and is hard to get exactly what you want. Does anyone know a lot abou this, if so can you give me some tips and tricks on it.....thanks!
Brian
ODBC Connection Using VB 6.0
Does anyone know of a way to use VB 6.0 to first detect if a certain ODBC connection is on the machine where the app is running, and if it does not have the ODBC connection, create one for the user to use. Any help would be appreciated.
ODBC Connection
Hi friends,
In my VB application I am using "Microsoft Jet Database engine" fordatabase connectivity. Can you please give me sample code andpre-requisition to connect through ODBC ?
Thank you very much in advance.
Tushar.
Crimp Circuits Inc.
ODBC Connection
Can anyone give an example on how I would connect to ODBC using VB?
Also anyone have a clue why the following line
Dim db as database
gives me this error?
'User-defined type not defined'
thanks
ADO Odbc Connection
Pleas look at the code and tell me what i have done wrong.
Cant get ir to connect to the ODBC database.
It wont work unless I install VB6 on the computer.
Short message due to problems posting.
/dkmart **********Who is General Failure, and why is he reading my disk?**********
http://www.pulare.se/Link/Kit145.zip
DAO ODBC Connection
Can anyone tell me how to create a DAO ODBC connection to a MS SQL server?
I can do an ADO connection like so:
Dim conn As adodb.Connection conn.ConnectionString = "driver={SQL SERVER};Server=Williamtell;DATABASE=" & sqldb & ";uid=accpac;pwd=accpac;"
conn.Open
I'm wondering what the DAO equivalent is? Also the reason I want to switch types is because when I run a record count on my ADO connection I get a record count as -1. Even if records are found it still gives me that count. Does anyone know why?
Thanks
ODBC Connection
I would like to know if there is a way where one can establish a ODBC connection programmatically. Even though I create a connection as below,
Public Connect As New ADODB.Connection
Set Connect = New ADODB.Connection
Dim sConnString As String
'Connnects to the database
sConnString = "Provider=MSDASQL; Data Source=;" & _
"User Id=;Password=;
Connect.CursorLocation = adUseServer
Connect.Open sConnString
when I install the appliction in different machines, I have to manually establish a ODBC connection going to Control Panel>Administrative Tools> Data Sources > System DSN, adding a new DataSource.
Can this be done through codes?
Odbc Connection
Hi guys its. Hope some one can help me with this problem.. Can i connec to the database without mapping the serve where my database is located using an ODBC Connection? I'm only using MS Acess 2000 as my database. Here is my sample code on Data connection?
Public db As Connection
Public rs As Recordset
Public Sub dbconnect()
If db Is Nothing Then
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=X:cmo_db.mdb;Persist Security Info=False"
End If
End Sub
Public Sub rsGlobal(str As String)
On Error GoTo err:
If rs Is Nothing Then
Set rs = New Recordset
Else
If rs.State = adStateOpen Then rs.Close
End If
'now open a new one
rs.Open str, db, adOpenDynamic, adLockOptimistic
Exit Sub
err:
MsgBox "SQL STATEMENT IS NOT CORRECT, PLEASE CHECK YOUR SYNTAX!", vbInformation, "SYSTEM MESSAGE"
End Sub
ODBC Connection
HI
Can anybody help me with some code on the ODBC Data Source Administration. How can my program look up if a file is already added to the USER DSN, and if not Add my Access.mdb file to the USER DATA SOURCE.
Thanx
Ivan
ODBC Connection !!
Hi friends,
I have 2 questions .
1. If Oracle (server installation ) is on
the server and its client is on another,
Can we create DSN connection for oracle db
in any other m/c (which is in LAN) which does not hv either ORACLE serverclient ?
And regarding Provider also ?
2. Wht abt SQL server?
ODBC Connection
I am using a MMI (Wonderware) Program to stuff data into a MS Acess DB Via an ODBC Connection. The MMI allows me to create new tables in the DB but does not allow me to create new DB's. I would like 1 table for each day of the week and a DB file for each week in the year. 52 DB files with 7 tables each.
The problem is that the MMI package does not allow me to create the new ODBC connection (needed for the next weeks DB file), Is there a way to create the new and delete the old ODBC connections Via VB command button.
The other option is to set up a DDE conversation between the MMI & the VB App to get the data in the DB for reporting. Any thought as to why this might be better / worse ??
Thanks
LJ
ODBC Connection
Hi
I want to know how to set up an ODBC connection in VB
All my setup in the Data Source Administrator are done..
but How I code this??
an ODBC newbie who wants help.... thanks
Make it with rocker style w/
DSN Less ODBC Connection
I'm working on a project that is still in the testing phase and will be moved around from server to server a little. Also the DB will change from Access to SQL Server. I need to execute a mail merge through code on a Word document. One of the methods for the MailMerge object is OpenDataSource which requires a ODBC connection string. My question is...
1)Is there any way to write a connection string that doesn't reference a DSN and still have it work ( I haven't been able to get it to work without actually creating and using a DSN ) or am I getting confused with OLEDB and wasting my time?
Here's an example of what I've been using...
"DBQ=" & Application("DBPath")& "Training.mdb;DriverId=281;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"
ODBC Connection
I need to know where is the error in following code for MS ACCESS connection through ODBC. Can I have the corrected code ?
private Sub Form_Load()
Dim PrivDb as Database
set PrivDb = OpenDatabase("", false, false, "ODBC;DSN=Hospital;UID=xxx;Pwd=xxx;")
End Sub
ODBC setting :
ODBC Driver = Microsoft Access Driver (*.mdb)
DSN = Hospital
Database = C:Hospital
UID = xxx
PWD = xxx
Note : The above code is working if i change the driver to Sql Server
Thanks.
Odbc Connection Failed
i run a certain application developed in access 97 and i converted it to access 2000.
my problem comes in whenever i try to select information into a combo of which its recordsource is a pass through query in access and a stored procedure in ms sql 2000.
whenever i try to select info into this combo i am always get this error
ODBC Connection (server name) failed
what could be the probable solution to my persistent problem
please help me
grant
Create ODBC Connection
Hi y'all,
I'm making a program in vb6 and SQL Server.
I've made a connectionstring with odbc.
Now I want to make a system dsn with visual basic 6. How can I do that?
Allready thnx
Help With Oracle ODBC Connection
I have a MS ACCESS/VB6 frontend with Oracle backend. It's not a project - just linked tables with modules. (It used to be just an Access application)
I've created a successful ODBC connection programmatically using UID and PWD information from a login form I created. The problem I have is that when I try to access a data form from a "Main Menu" displayed after successful connection, an Oracle8 ODBC Login pops up and wants me to log in again. I only want one login at the beginning.
How can I do that? I've been searching through forums and code for days and they all look alike now. This is my first attempt at ODBC ....
Dim strConnect As String
Dim strUserName As String
Dim strPassword As String
Dim cn As ADODB.Connection
strConnect = "UID = " & strUserName & ";" & "PWD = " & strPassword & ";" & "DRIVER={Microsoft ODBC for Oracle};" _
& "SERVER = STRDB.nswc.navy.mil;"
Set cn = New ADODB.Connection
With cn
.ConnectionString = strConnect
.CursorLocation = adUseClient
.Open
End With
Odbc Connection Problem
I am having problems from a particular client machine opening an particular Access database (db1) that has tables linked to SQL server
The error is get is listed below:
I get Connection failed:
SQLState: 'S1000'
SQL Server Error: 126
[Microsoft][ODBC SQL Server Driver] Unable to load communication module. Driver has not been correctly installed.
Connection failed:
SQLState: '08001'
SQL Server Error: 0
[Microsoft][ODBC SQL Server Driver]Client unable to establish connection
I am able test the data source successfully in ODBC Data Source Administrator from that client machine.
I can also open another database (db2) from that same client machine and access is able to connect successfully.
It is only db1 that keeps getting this error.
One thing that was interesting is that if I open up db2.mdb first (which always opens successfully), close out and reopen db1.mdb I am able to connect successfully. Anytime I try opening db1.mdb first, I get the same error.
I was thinking that maybe the client machine needs the latest SQL server driver .... but I don't know if this is the problem.
Even trying to find the driver and install it is a problem:
I tried copying the latest driver from a client machine that works.
SQLSRV32.dll but I quickly found this method does not work.
I was able to find SQLServer SP2 .... but I don't know how to install just the drivers .... it seems you need some other software installed before you can run setup.exe
Any help would be much appreciated!
Lorin
ODBC Connection Error
Hello,
I'm using ODBC to connect my VB6 application to a MS SQL database.
I have created a new System DSN and it works well.
The code is OK but the connection doesn't work. the message is: "Cannot open database requested in login "....". Login fails.
Could you help me?
Thanks
Sylvain
Setting Up ODBC Connection
Hello,
I need to be able to have my APP set up a ODBC connection if one is not there. I need to set up a FILE DSN session, I can do this manually but how do I tell the program to do it?
How Do I Set Up An ODBC Connection To Two Servers
I have no problem setting up the ODBC connection to one server but I want it so if one server fails the program will automatically connect to the other server and continue. Anyone have any ideas on how to do this? I was told all I had to do was to set the Database part of the connection string equal to 'computer1name:dbname, computer2name:dbname'. Does anyone know if there is a problem with this? thanks for the help
Establishing ODBC Connection
Hi All,
Im pretty new to client/server programming using vb5. I'm trying get my vb form to work with an access database, i can do this fine using the data control but have found this somewhat limiting and so what to connect using ODBC with out the data control.
However i seem to be getting the following error:
Run time error '3423'
You can not use ODBC to import from, export to, or link an external microsoft JET or ISAM databse table to your database.
Anyone have any ideas what this is referring to and whati need to look into and able to shed a little light? Any advice would be greatly appreaciated!
Thanks
ODBC Connection Problem
Hi all, i connect to my database using this command
Code:
Dim password As String
password = "ana12"
con.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=C:db1.mdb;" & _
"Exclusive=1;" & _
"Uid=admin;" & _
"Pwd=" & password
sql = "SELECT * FROM tab1"
'open the recordset
rst.Open sql, con, adOpenKeyset
The database is password protected, and it stops at the
Code:
rst.Open sql, con, adOpenKeyset
the runtime error says :[microsoft][ODBC Microsoft access driver]Too few parameters expected 1.
What could i be possibly be doing wrong?
Thanks Dave
Creating Odbc Connection With Vb6.0
Dear VB users,
At the moment, we have to create via our "control panel", "administative tools" and "datasources(odbc)" an odbc connection.
Is it possible with the help of vb6.0 creating an odbc connection?
If yes, can someone pls give source?
Nice regards,
Michelle.
Check ODBC Connection
is there a way i can check an ODBC connection before i actually attempt to connect to it? I would need to check that it is actually there on the PC and then test connect it to make sure it worked... I could just trap the error.. but i was wondering if there is a better way to do it
ODBC Connection Strings
I know this is not a VB question but there is nobody in the asp forum. Please have a look at the following link
http://www.vbforums.com/showthread.p...hreadid=236074
Your help would be much appreciated.
Add A New 32-Bit ODBC Connection In Code ?
Is it possible to add a new ODBC connection in code, rather than adding manually for each PC that uses the program ?
I would need to take into account whether the user is on Windows 2000 or Wnidows 98, as we have both.
Anyone point me in the right direction ?
Thanks in advance ......
MySQL Connection - Without ODBC
Where do you start with this. I have got it to work with a DSN and the mySQL oDBC driver but I don't want to havbe to install that on every machine....
Paradox 8 Dao Odbc Connection
Please forgive my ignorance but I have only used Access databases with my projects.
Could anyone give me an example of how to open a paradox 8 table using ODBC?
My DSN = Paradox8
database name = app.path & "PartsInventory.db"
Any help would be very much appreciated.
Thanks,
Dan
Password For ODBC Connection
I've got an ActiveX coponent which connects to an Access database.
That database contains some tables which are actually in the database,and some are links to an Oracle database using ODBC
I have a query which looks up data on the Oracle DB.
The Access database doesn't require a password to open but when I run a query on the oracle tables it wants a password.
How can pass a password in the query?
Create An ODBC Connection
Hi,
I have some code to create an ODBC connection to an SQL server.
With this code I am not able to add some parameters to the connection.
How can I make a selection between Windows NT authentication or SQL server authentication ?
How can I select the client configuration that I need (Named Pipes, TCP/IP, Multiprotocol, ...
Thanks
Code:
Private Declare Function SQLConfigDataSource Lib "ODBCCP32.DLL" _
(ByVal hwndParent As Long, ByVal fRequest As Long, ByVal lpszDriver _
As String, ByVal lpszAttributes As String) As Long
Private Const ODBC_ADD_DSN = 1 ' Add data source
Private Const ODBC_CONFIG_DSN = 2 ' Configure (edit) data source
Private Const ODBC_REMOVE_DSN = 3 ' Remove data source
Private Const ODBC_ADD_SYS_DSN = 4 ' Add data source
Private Const ODBC_CONFIG_SYS_DSN = 5 ' Configure (edit) system data source
Private Const ODBC_REMOVE_SYS_DSN = 6 ' Remove system data source
Function cmdODBC_Create()
Dim lpszDriver As String
Dim lpszAttributes As String
Dim retVal As Long
lpszDriver = "SQL Server"
Dim DSN_NAME
Dim SERVER_NAME
Dim DATABASE_NAME
Dim sUID
Dim sPWD
DSN_NAME = "aName"
SERVER_NAME = "aServer"
DATABASE_NAME = "aDatabase"
sUID = "aUID"
sPWD = "aPWD"
lpszAttributes = "DSN=" & DSN_NAME & Chr$(0)
lpszAttributes = lpszAttributes & "Description= Test DSN" & Chr$(0)
lpszAttributes = lpszAttributes & "Server=" & SERVER_NAME & Chr$(0)
lpszAttributes = lpszAttributes & "Database=" & DATABASE_NAME & Chr$(0)
retVal = SQLConfigDataSource(0, ODBC_REMOVE_SYS_DSN, lpszDriver, "DSN=" & DSN_NAME & Chr$(0))
retVal = SQLConfigDataSource(0, ODBC_ADD_SYS_DSN, lpszDriver, lpszAttributes)
lpszAttributes = "DSN=" & DSN_NAME & Chr$(0)
lpszAttributes = lpszAttributes & "SQL_USER_NAME=" & sUID & Chr$(0)
lpszAttributes = lpszAttributes & "PWD=" & sPWD & Chr$(0)
retVal = SQLConfigDataSource(0, ODBC_CONFIG_SYS_DSN, lpszDriver, lpszAttributes)
If params > 0 Then End
End Function
ODBC Connection Timeout
I am having problems with timeouts on my ODBC connection. I specify that the connection timeout should be 5 minutes, but it timesout after like 1. Here is what I am using. Is there somewhere else I should be setting this?
Code:
cn.Open("DSN=SB;uid=qcdept;pwd=*******;connectiontimeout=300")
VB ODBC Connection To Informix
Hi,
I'm trying to connect to an Informix database via an ODBC connection string in VB 6.0. Here is my connection string:
Code:
con.ConnectionString = "DRIVER={INFORMIX 3.30 32 BIT};
DB=test;Server=standard;
Host=risinsun;
UID=test;
PWD=test;"
The error I'm getting when I try to open the connection is:
Quote: Run-time error'-2147467259 (800004005)':
Informix ODBC Driver General Error.
Does this look like a syntax error or something else? I've tried many combinations - with/without the host etc. I have tested the ODBC driver and the connection works great outside of VB and in Crystal Reports.
Any help always appreciated!
ODBC Connection Information
Thanks to everyone who helped with the parameters question. Unfortunately,
my 4.0 version limits my options, but I've saved Richard and Mark's
suggestions for future reference.
I am now attempting to dynamically create an ODBC connection, which appears
to involve creating Windows Registry entries. However, I do not see how I
can do this with 4.0. It is apparently possible to update registry entries
under the Visual Basic application key, but no others.
I need to do this because the ODBC connection information may not contain
the directory to which I need to connect. By creating a connection
dynamically, I can ensure I'll be able to use the directory I need.
Any suggestions?
Donald R. Fisher, III
Project Manager
The Roomstore Furniture Company
(804) 784-7600 extension 2124
email@removed
Need Help With A Record Set And An ODBC Connection
Hi,
I am trying to get this code to work, but it keeps stoping on the cn (Set cn = OpenConnection("", dbDriverComplete, False, scn)) line for the connection to the SQL Server. The error says that the opperation is not supported by this type of object. I got this from a book, As usal I think they are leaving some code out. And I need a way to do this through ODBC, because that is what the company wants.
Here is my code:
Private Sub Form_Load()
Dim db As Database
Dim cn As Connection
Dim rs As Recordset
Dim rs2 As Recordset
Dim scn As String
Dim strsql As String
Dim qd As QueryDef
Dim wkODBCDirect As Workspace
Dim strsql2 As String
Dim qd2 As QueryDef
'Connection String
scn = "ODBC;DRIVER=SQL SERVER;SERVER=BOB-MDTNZL7OFKX;DATABASE=pubs"
Set cn = OpenConnection("", dbDriverComplete, False, scn)
'Creates the record set
Set rs = cn.OpenRecordset("Select * From sales", dbOpenDynaset)
cboStoreID = rs![stor_id]
End Sub
Any help would be really appreaciated
Thank you
Connection Setup Using ODBC
Hi,
I am trying to build a tool on top of an enterprise accounting system. The accounting application uses ODBC and connects to the MASTER in SQL server. When the user launches the application a drop down box is availble that shows all the databases found on the server ( this includes DB's that do not have a DSN setup).
I am trying to figure out how I can replicate that connection. I have the DSN setup connected to master but I need to actually connect to a particular DB that will not have a DSN. The database names,server names, etc are different for every client so I cannot connect using an ADO connection string coded, nor can I connect using DSN, because there will only be ONE DSN connected to the master.
Any ideas on how this works??
Thanks for any and all input.
Regards,
MDA
|