Excel 2007 File name lenght

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm experiencing troubles when doing a sql against a .dbf file with a name
longer than 8 digits. But just in some computers, others work fine.

What makes this and how to fix it?

Thanks,
 
sharon said:
I'm experiencing troubles when doing a sql against a .dbf file with
a name longer than 8 digits. But just in some computers, others work
fine.

What makes this and how to fix it?

Anything that works on some PCs but not others is almost certainly due
to configuration differences between the PCs. In this case, the odds
are that the PCs which choke on this filename have older DBF ODBC
drivers. You'd need to use the ODBC Data Sources applet in Control
Panel to check the version numbers of the DBF ODBC drivers on the PCs
on which your SQL query chokes against the version number on some PC
on which your SQL query works.

If that's not the problem, on what sort of disk are these DBF files
located?
 
Hi Harlan,

I don't think the ODBC sources cause the problem, because in both computers
are the same. Moreover I am doing sql via VBA, as follows:

.....
......
strCon = "driver={Microsoft dBase Driver (*.dbf)};"
strCon = strCon & "driverid=277;dbq=" & Range("PATHTECOFIT")
cnBase.Open strCon

If Range("HISTO") = True Then
sqlCOL = "SELECT
RCCVCVE,RCCVPRO,RCCVDPR,RCCVUNI,RCCVKGS,RCCVPTU,RCCVPTS,RCCVDAT,RCCVCLI,RCCVCCL,RCCVNFC FROM RCCVE9704"
sqlCOL = sqlCOL + " WHERE RCCVLOT='" & Range("FILCLI") & "'"

vFil = vFil & " ORDER BY RCCVDAT"
sqlCOL = sqlCOL & vFil
rCOL.Open sqlCOL, cnBase, , , adCmdText
If rCOL.EOF Then
rCOL.Close
cnBase.Close
Exit Sub
Else
Range("a3").CopyFromRecordset rCOL
End If
rCOL.Close
End If
........
........

The code breaks and the message I have is it can't find the file
"RCCVE9704". As stated, it work fine in other (Excel 2007) computers, with
same ODBC drivers installed.

I would think it must be an option in Excel 2007 which enables accessing a
longer than 8 digits name when file is DOS . Could it be? (If I change the
name to RC9704 then it works fine!)

Kind regards,
 
Back
Top