View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
K.K.[_2_] K.K.[_2_] is offline
external usenet poster
 
Posts: 8
Default Problem with ADO connection fm VB6 to Excel

Hi All,

I have a vb6 app that will read some data from an excel file (on several
worksheet) then proccess them, because I don't need to update the file so I
use Ado connection to read the file (find it a little faster). However, *
sometimes * it gives me the following error when it try to execute the SQL

"Selected collating sequence not support by the operating system"

And I have the following code :


Sub ProcssInvoicingFile(pFilePath As String, pFileName As String)
Dim AdoconXls As ADODB.Connection
Dim rsXls As ADODB.Recordset


With AdoconXls
.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source= " & pFilePath & pFileName & ";" & _
"Extended Properties=""Excel 8.0;HDR=No;IMEX=1"""
.Open
End With

sSQL = "Select * from Sheet1$ Where Len(F1) 0"
Set rsXls = AdoconXls.Execute(sSQL) ' * * Get error here * *

'More code for processing.....


End sub

Once I hit the "Debug" button, which will bring me back to VB and if I
continue to run the app (without stopping it), it just execute as usual, no
error prompted, does anyone know what's wrong? If you need more info please
let me know, thanks in advance~!

K.K.