` Printed Icetips Article

Icetips Article



Par2: MS Access connection string
2009-02-19 -- Carl Sumner
 
am working with Access mdb files for a client. The Owner field needs
a different string, that defines the connection to the physical file
and gives the mdb name.

The Clarion operations use the table name, so that is what you will
see in the messages.

This is the string we use. It is actually in a Global string, and the
Owner is set as "!Shipping_mdb". We allow the path to be set up from
the ini file. You might not need all of the settings.

file_path               STRING(80)
Shipping_mdb        STRING(255)

  file_path = getini('File Paths','Shipping',,'shipping.ini')

  Shipping_mdb  =  'DSN=MS Access Database;DBQ=' & clip(file_path) &
'\shipping.mdb;DefaultDir=' & clip(file_path) & ';DriverId=25;FIL=MS
Access;MaxBufferSize=1024000;PageTimeout=5;'

Make sure the table has a primary index. If not, at least make sure
the "additional sort fields" (in browse and process) has enough to
make a unique record.

I think that adding an extra index to the dictionary can work, as long
as it doesn't try to create the table. At least in some versions, it
only gives an error-47 if the fields it tries to find are different.

Names with spaces will need to be quoted with apostrophes like this:
`Hazard class`. But the import should have done that automatically.



Printed November 21, 2024, 12:35 pm
This article has been viewed/printed 35334 times.