-
Oct 19th, 2017, 01:56 AM
#1
Thread Starter
New Member
Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastrophi
Hi, my pc is windows 10 64bit, vb6 installed but NOT selecting the ADO provider option for data access component during vb6 installation.
these are my vb6 code,
Set gDBConn = New ADODB.Connection
gDBConn.Open "myOracle11ServiceName", "myUserID", "myPasswd"
the vb6 crashed when it run the line gDBConn.Open "myOracle11ServiceName", "myUserID", "myPasswd"
error : 2147418113 catastrophic failure
?gDBConn.Provider = MSDASQL
btw, in excel vba on the same pc, i can run the line in vba code without any problem: gDBConn.Open "myOracle11ServiceName", "myUserID", "myPasswd"
it seems my vb6 installation got problem
-
Oct 19th, 2017, 05:28 AM
#2
Re: Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastr
It may not be relevant but I remember having to point to a backward compatible binary on Windows 7:
https://stackoverflow.com/questions/...k-in-windows-7
Please remember next time...elections matter!
-
Oct 19th, 2017, 02:10 PM
#3
Re: Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastr
MSDASQL is the thunk Provider, an adapter layer for working with an ODBC Driver.
It sounds like perhaps you have a 64-bit ODBC Driver but not a 32-bit ODBC Driver.
Or if "myOracle11ServiceName" is a system DSN (as sounds likely) then you have a 64-bit DSN defined, but not a 32-bit DSN defined using the same name.
Ideally you wouldn't use a DSN at all, let alone a system DSN. Even better, use an OLE DB Provider for the DBMS instead of thunking through to ODBC that way.
If you must use ODBC, skip the DSN entirely and use either a connection string fully specifying your connection, or a .UDL file.
-
Oct 19th, 2017, 03:45 PM
#4
Re: Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastr
If you want the 32bit ODBC Data Source Administrator app, its located here:
Code:
%systemdrive%\Windows\SysWoW64\odbcad32.exe
It probably isn't located in your Control Panel, only the 64bit version is there.
but like dilettante said - don't bother, just use the OLE DB provider directly.
-
Oct 19th, 2017, 07:40 PM
#5
Thread Starter
New Member
Re: Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastr
many thanks, i'll take a look asap
-
Oct 19th, 2017, 11:55 PM
#6
Thread Starter
New Member
Re: Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastr
thanks to the guides I got here from the super heroes TysonLPrice , dilettante, DEXWERX, I try the following and it works! but still no idea why the other version not working. still need help to understand why this error happens.
Dim strDatabase
Dim strUserName
Dim strPassword
Dim dbDatabase
strDatabase = "testDB" ' as defined in the file tnsnames.ora
strUserName = "user2"
strPassword = "passwd2"
Set dbDatabase = CreateObject("ADODB.Connection")
dbDatabase.ConnectionString = "Provider=OraOLEDB.Oracle;Data Source=" & strDatabase & ";User ID=" & strUserName & ";Password=" & strPassword & ";"
dbDatabase.Open
-
Oct 20th, 2017, 07:51 AM
#7
Thread Starter
New Member
Re: Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastr
dilettante,
is there any way to simplify the oracle connection and bypass DSN? as I am not sure what other provider or other things I need to install,
is there any Oracle connection string that doesn't require to have a DSN for the connection.
how to create a connection string based on the content of the following tnsnames.ora file
OracleSIDname=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.164.113.12)(PORT=1521)))(CO NNECT_DATA=(SERVICE_NAME=MyOracleSID)));
-
Oct 23rd, 2017, 04:24 PM
#8
Fanatic Member
Re: Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastr
Code:
Conn = "UID= " & UID & ";PWD=" & PWD & ";DRIVER={Microsoft ODBC For Oracle};" & "SERVER=" & dBase & ";" 'dBase here is ora TSN name.
' Conn = "UID= " & UID & ";PWD=" & PWD & ";DRIVER={Microsoft ODBC For Oracle};"
Screen.MousePointer = vbHourglass
'Connect to ORACLE DB
With DB
.ConnectionString = Conn
.CursorLocation = adUseClient 'default is adUseServer
.CommandTimeout = 180
.Open
If .State = 1 Then
'Connected to database.
Else
'No database connection.
End If
-
Oct 24th, 2017, 02:28 AM
#9
Re: Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastr
Here my Oracle connection string I've use with no problem.
Need to install the Oracle client:
Code:
sConnString = "Driver=(Oracle in OraHome92);Password=" & sPwd & ";Persist Security Info=True;User ID=" & sUser & ";Data Source=" & sSID
For a complete lists of connection strings see here:
https://www.connectionstrings.com/oracle/
-
Oct 24th, 2017, 10:53 AM
#10
Re: Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastr
The Persist Security Info property tells whether or not to store user/pw into a UDL or DSN on a save operation. No idea why you'd want it True here.
-
Oct 24th, 2017, 11:05 AM
#11
Re: Open a New ADODB.Connection in vb6 on windows 10 64bit - error 2147418113 catastr
Hi,
you could try the CreateOraObject (OraDatabase) Method
Code:
'Declarations
Dim OraSess as Object
Dim OraDb as Object
Dim Dyna as Object
'Code:
Set OraSess = CreateObject("OracleInProcServer.XOraSession")
Set OraDb = OraSess.DbOpenDatabase("oracle8","User1/geheim",0&)
'Parameter:
'Parameter 1 ("oracle8") is Databse or HostString
'Parameter 2 ("User1/myPass") ist UserName/Password
Set Dyna = OraDb.CreateDynaSet("Select * from Kunde",0&)
for i = 0 to Dyna.RecordCount
text1 = Dyna.Fields(0).Value
text2 = Dyna.Fields(1).Value
text3 = Dyna.Fields(2).Value
text4 = Dyna.Fields(3).Value
Dyna.DbMoveNext
Next i
here also a Link .https://docs.oracle.com/cd/B28359_01...78/clients.htm
regards
Chris
to hunt a species to extinction is not logical !
since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|