If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Other > ADO connection to Image database

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-12-03, 07:39
Karibu Karibu is offline
Registered User
 
Join Date: May 2003
Posts: 12
Question ADO connection to Image database

Hello. I am changing my DAO connection to ADO connection in my VB application and I need some advise on what to write. My current connection is made as follows and it works:

Code:
Global wrk1 As Workspace 
Global con1 As Connection 
Dim sDsn As String 

sDSN = "SOTK" 

' Create connection to SOT system 
Set wrk1 = CreateWorkspace("ODBCSOT", "admin", "", dbUseODBC) 
wrk1.DefaultCursorDriver = dbUseODBCCursor 
Set con1 = wrk1.OpenConnection("ODBCSot", dbDriverNoPrompt, True, "ODBC;DATABASE=" & sDsn & ";DSN=" & sDsn) 

SQL = "SELECT * FROM DBVSTO.ALUSTA WHERE ALU_TYYPPI = 'C' " 
SQL = SQL & " AND ALU_VARUSTAMO NOT IN ('STEV','EGON') AND " 
SQL = SQL & " ALU_VARASTO <> 'RC'" 

Set rs = con1.OpenRecordset(SQL, dbOpenSnapshot, dbExecDirect)
However, I want to make it to work through ADO, not DAO. How do I do it?

I have figured that it has bo be something like this:

Code:
Dim gKONRAPRecordset As New ADODB.Recordset 

SQL = "SELECT * FROM DBVSTO.ALUSTA WHERE ALU_TYYPPI = 'C' " 
SQL = SQL & " AND ALU_VARUSTAMO NOT IN ('STEV','EGON') AND " 
SQL = SQL & " ALU_VARASTO <> 'RC'" 

Set gKONRAPRecordset = New ADODB.Recordset 
gKONRAPRecordset.ActiveConnection = "Provider=MSDAORA;Data Source=SOTK;User Id=admin;" 
    
gKONRAPRecordset.Open SQL

The problem is that Provider is not MSDAORA, but something else. I could not find any reference from the net what I should write into that. The database behind is old IMAGE database. Of course, I have all the necessary ADO references and components in my project.

My ODBC driver is as follows:

ODBC-driver: ODBCLink/SE-32 Driver
Data Source Name SOTK
DataBase Name TilasDBE.FILEK
Server Name HP13
Server Type MPE/iX
Session ID MHU
User Name MGR
Acct Name JORA
Group Name FILEK

Whe I execute my new code, it gives me following error:

ORA-12154 TNS: Could not resolve service name

This would suggest it tries to read my Oracle connection (I have ODBC connection to Oracle database also), but that is not what I need in this. It should use that ODBCLink/SE-32 Driver connection. Any help appreciated.
__________________
------------------------------------
Long days and pleasant nights
- Roland the gunslinger
------------------------------------

Last edited by Karibu; 05-12-03 at 07:41.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On