Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Working with ODBC..
Message
De
27/04/2009 06:01:22
 
 
À
27/04/2009 03:42:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01396459
Message ID:
01396465
Vues:
83
Hi
Sorry for intermeddling

I have to retrieve data from active access database with variable criteria.
The ACCESS tables name is 'data' and 'pictures' while data.imageid=pictures.id and unfortunately pictures.id is integer and data.imageid is string (The access is not my project and I cannot change it).
I get error 232 ("TEMP" is not an array (Error 232)) on the following code:
local llok, lcerrormessage 
llok = .t.
lcerrormessage = ""
local lcmdb
if m.llok
	lcmdb = getfile('mdb')
	llok = file(m.lcmdb,1)
	lcerrormessage = ""
endif

local lcconnectionstring, h
if m.llok
	lcconnectionstring = ;
		"DRIVER=Microsoft Access Driver (*.mdb);" + ;
		"DBQ=" + justfname(m.lcmdb) + ";" + ;
		"DefaultDir=" + justpath(m.lcmdb) + ";" + ;
		"DriverId=25;FIL=MSAccess;MaxBufferSize=2048;PageTimeout=5"
	h = sqlstringconnect(m.lcconnectionstring)
	llok = ( h > 0 )
	if !m.llok
		lcerrormessage = getlasterror()
	endif
endif

local n

local lctable,lctable2
if m.llok
	lctable = 'data' && whatever your specs say
	lctable2='pictures'
	n = sqlexec(h,[Select * From ] + m.lctable,m.lctable2+ [ WHERE  INT(VAL(lcTable.imageid))=lcTable2.ID;
   AND  lcTable.Nomber LIKE '%99%'],'temp')
	llok = ( n > 0 )
	if !m.llok
		lcerrormessage = getlasterror()
	endif
endif
if m.llok
	browse
endif

try
	sqldisconnect(h)
catch
endtry
if !m.llok and !empty(m.lcerrormessage)
	messagebox(m.lcerrormessage,48)
endif
return

function getlasterror()
	local lcmessage, laerror[1]
	lcmessage = ""
	aerror(laerror)
	if type('laError[2]') = 'C'
		lcmessage = laerror[2]
	endif

	return m.lcmessage
endfunc
tHANKS
Thank you
Chaim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform