lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


I'm getting an error that can be reproduced with the script at the bottom of the mail.

Basicly I was trying to compair differing speeds of various DB systems under LuaSQL when I noticed the second database table wasn't being fully traveresed but was instead ending with a '[Microsoft][ODBC Driver Manager] Function sequence error' after fetching only a few records (the number of which changes depending on the number of records fetched from the first DB) I was using several different DB engines setup with matching tables/data.

System: Win2000
Compiler: VC++ 6 (SP5) both Debug and Release builds tried
Lua: 4.0.1 + LuaSQL
ODBC Core: MS 3.520.5303.2
ODBC DB Drivers: Various (MS Access, Firebird)

-- Sample Script --

print("Starting First DB...")

ENV, err = SQLOpen()
assert(ENV, err)

CON, err = ENV:Connect("LuaSQL Test 1", "", "")
assert(CON, err)

CUR, err = CON:Execute("SELECT * FROM AnyTable")
assert(CUR, err)

c1 = 0
row = CUR:Fetch()
while row do
	c1 = c1 + 1
	row, err = CUR:Fetch()
end

print(c1, err)
CON:Close()
ENV:Close()
ENV = nil

print("Starting Second DB...")

ENV2, err = SQLOpen()
assert(ENV2, err)

CON, err = ENV2:Connect("LuaSQL Test 2", "", "")
assert(CON, err)

CUR, err = CON:Execute("SELECT * FROM AnyTable")
assert(CUR, err)

c2 = 0
row = CUR:Fetch()
while row do
	c2 = c2 + 1
	row, err = CUR:Fetch()
end

print(c2, err)
CON:Close()
ENV2:Close()