Using an Access Database

BlitzMax Forums/BlitzMax Beginners Area/Using an Access Database

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I have some plans for a new cross-platform database module.

Another one, you say?
I want prepared statements in my SQLs, and I didn't fancy back-fitting that functionality into another module.

You know, kind of like :
	' get a new query object 
	Local query:TDatabaseQuery = TDatabaseQuery.Create(db)

	' prepare the insert statement
	' by preparing it once, the database can reuse it on succesive inserts which is more efficient.
	query.prepare("INSERT INTO person values (NULL, ?, ?)")
	
	If db.hasError() Then
		errorAndClose(db)
	End If

	' iterate round the array inserting new entries
	For Local i:Int = 0 Until names.length
		query.bindValue(0, TDBString.Set(names[i][0]))
		query.bindValue(1, TDBString.Set(names[i][1]))

		query.execute()
		
		If db.hasError() Then
			errorAndClose(db)
		End If
	Next


I think I also want "Iterator" support for result sets.. which would tie in nicely with Lists and suchlike.

The nice thing with ODBC is, that once you have it working with one driver, it should (in theory) automagically work with all drivers.

And why have database-specific modules as well as ODBC?
ODBC is a bridge, so it's generally not as efficient as hitting the native drivers.


MySQL is currently being a bit of a pain in the arse with it's bindings, but it's getting there.

...the answer was no.

Who said no? BRL? That's not very surprising really.

Once MySQL is working, I'll have a go with ODBC. Can't be *that* hard, as Mark says ;-)