Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DBase ODBC Blues
Message
De
30/12/2003 14:27:39
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
DBase ODBC Blues
Divers
Thread ID:
00862923
Message ID:
00862923
Vues:
52
I’m a newby when it comes to ODBC, and I’m afraid it shows. I need to connect to a dBase 5 table for both read and write. I created a DSN manually that works just fine, but I need to re-create that under program control on customer machines. I downloaded Mark McCasland’s excellent ODBC DSN class from the files section, Download#9749. When I run his class.FindUserDSN() method against my existing DSN, I get the following settings pairs:
lavals[1,1]		“Driver”
lavals[1,2]		“C:\WINDOWS\System32\odbcjt32.dll”
lavals[2,1]		“DefaultDir”
lavals[2,2]		“C:\PROJECTS\CSST\REPORTS\PIR2003”
lavals[3,1]		“Description”
lavals[3,2]		“connection to Xtria PIR report software table”
lavals[4,1]		“DriverId”
lavals[4,2]		533
lavals[5,1]		“FIL”
lavals[5,2]		“dBase 5.0”
lavals[6,1]		“Safe Transactions”
lavals[6,2]		0
lavals[7,1]		“UID”
lavals[7,2]		“”
My code to recreate the DSN looks like this:
lcConnectionString = "DBQ=" + lcPath + CHR(0) + ;
		     "DefaultDir=" + JUSTPATH(lcPath) + CHR(0) + ;
		     "Description=Report Table DSN" + CHR(0) + ;
		     "Safe Transactions=0" + CHR(0) + ;
		     "UID=" + CHR(0)

loODBC.CreateUserDSN(ODBC_MS_DBASE,lcConnectionString)
…where loODBC is the instance of Mark’s class, ODBC_MS_DBASE is the driver name, and lcPath is the full path name of my dBase target table. I’ve tried just about every combination of settings in the connection string that I can think of, but still no success creating the DSN on the fly. Can anyone point out where I’m going wrong?
Ray Roper
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform