Hello Aceger
Your Question:
QUESTION:
In VB6 IDE the following code produces this error:
"Error when opening database link"
The code:
Dim oSess As xapiSession
Set oSess = CreateObject("ACCPAC.xapiSession"

oSess.Open [USERID], [PW], [DATABASE], [DATE],0
Any help would be greatly appreciated.
My answer :
Firstly :
If you using VB6 then you need to set a reference to the ACCPACXAPILIB 1.1. You do this by going to Project/References and then select ACCPACXAPILIB 1.1.
After youve dont that, you must change your code to look like this :
Dim OSess as AccPacXApilib.xapisession
In normal AccPac VBA you dont have to reference that AccPacXApilib you can just type Dim Osess as xapisession like you have it in your question
Secondly, your Session OPEN method syntax is
OSess.open "USERID","PASSWORD","ORGID",date,o
2.1 Make sure it is strings and not in [] blocking
2.2 Make sure all is case sensitive
2.3 Make sure your ORGID is the exact name of the "COMPANY" like you have specified it when you created it.
Hope it helps
JayCee