Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Working with ODBC..
Message
From
27/04/2009 06:01:22
 
 
To
27/04/2009 03:42:54
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01396459
Message ID:
01396465
Views:
82
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform