Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a DBF file with ADO - file Name Length?

Status
Not open for further replies.

nvwildfire

Technical User
Aug 15, 2002
43
0
0
US
Hello everyone, I think this is an easy question so here it is. I am creating a DBF file with ADO, the following is the code used:

Set fConn = New ADODB.Connection

fConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & OPath & ";" & _
"Extended Properties=""DBASE IV;"";"

strCT = "CREATE TABLE " & OPath & "\" & OName & "(FMU SMALLINT, SCORE int, PROB double, SCHEMA1 varchar(30))"

fConn.Execute strCT

The problem I am having is that the .dbf file name is getting trunkated to 8 characters, even though OPath maybe longer than 20 characters.

I think I am just going to rename the file after it is created unless someone else knows how to resolve the 8 character limit. Any help would be greatly appreciated.

Thank you,

kgk
 
I'm not sure if this will work but you could try putting quotes (") around the full path name thereby telling it to use the long filename. Try the line below ad let me know if it works.

strCT = "CREATE TABLE " & Chr(34) & OPath & "\" & OName & "(FMU SMALLINT, SCORE int, PROB double, SCHEMA1 varchar(30))" & Chr(34)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top