ODBC Error

Just starting out? Need help? Post your questions and find answers here.
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

ODBC Error

Post by loulou2522 »

This instruction seems not working

Code: Select all

XIncludeFile #PB_Compiler_Home+"comate\adoconstants.pbi"

  XIncludeFile #PB_Compiler_Home+"comate\Module COMatePLUS.pbi"
  UseModule comate
 
Global.comate::COMateObject  adoConnection, adoRecordSet, cmd

 
Global databasename.s=GetCurrentDirectory()+xxx\xxx.xlsx"
 
 
  Global ConnectionString.s = "Provider=Microsoft.JET.OLEDB.4.0;Data Source=" + Databasename+ ";Extended Properties=" + Chr(34) + "Excel 8.0;HDR=Yes;Readonly=0;Readonly=False;IMEX=0" + Chr(34) 
  adoConnection =comate::COMate_CreateObject("ADODB.Connection")
  If #E_FAIL
    
      Global ConnectionString.s = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" +Databasename+ ";Extended Properties=" + Chr(34) + "Excel 12.0 xml;HDR=Yes;Readonly=False;IMEX=0" + Chr(34) 
    adoConnection =comate::COMate_CreateObject("ADODB.Connection")
  EndIf 
ado!connection doesn't want to be initialize
Can someone help me ?