BlitzData 1.2 RC8

Miscellaneous Forums/Blitz Showcase/BlitzData 1.2 RC8

Here's the latest decls file. You'll note a few more commands at the end of it. I have to redo a few of the docs and rebuild. I'll have that within the hour.

;Declarations file for blitzdata.dll

.lib "BlitzData.dll"
BD_OpenDatabase%(Server$,Database$,UserName$,Password$,dbtype%):BD_OpenDatabase
BD_CloseDatabase():BD_CloseDatabase
BD_GetDatabaseState%():BD_GetDatabaseState
BD_GetTableState%():BD_GetTableState
BD_FirstRecord():BD_FirstRecord
BD_NextRecord():BD_NextRecord
BD_PreviousRecord():BD_PreviousRecord
BD_LastRecord():BD_LastRecord
BD_RecordCount%():BD_RecordCount
BD_SQLQuery%(query$):BD_SQLQuery
BD_CloseQuery():BD_CloseQuery
BD_GetColumn$(colname$):BD_GetColumn
BD_AddRecord():BD_AddRecord
BD_UpdateRecord():BD_UpdateRecord
BD_SetStringColumn(col$, val$):BD_SetStringColumn
BD_SetIntegerColumn(col$, val%):BD_SetIntegerColumn
BD_SetFloatColumn(col$, val#):BD_SetFloadColumn
BD_BeginTransaction():BD_BeginTransaction
BD_RollbackTransaction():BD_RollbackTransaction
BD_CommitTransaction():BD_CommitTransaction
BD_CreateJetDatabase(fname$,typ%):BD_CreateJetDatabase
BD_CreateJetTable(fname$,table$):BD_CreateJetTable
BD_AddJetColumn(fname$,table$,col$,typ%,siz%):BD_AddJetColumn
BD_SendSQLCommand(sql$):BD_SendSQLCommand
BD_SetDebugMode(mode%):BD_SetDebugMode
BD_DeleteRecord():BD_DeleteRecord
BD_RecordSetBOF%():BD_RecordSetBOF
BD_BOF%():BD_BOF
BD_RecordSetEOF%():BD_RecordSetEOF
BD_EOF%():BD_EOF
BD_ColumnName$(ord%):BD_ColumnName
BD_ColumnCount%():BD_ColumnCount
BD_ColumnDataType%(colname$):BD_ColumnDataType
BD_ColumnSize%(colname$):BD_ColumnSize
BD_SetCacheSize(csize%):BD_SetCacheSize
BD_GetCacheSize%():BD_GetCacheSize
BD_SetBookmark(ord%):BD_SetBookmark
BD_ReturnToBookmark(ord%):BD_ReturnToBookmark
BD_ClearBookmark(ord%):BD_ClearBookmark
BD_GetLastError%():BD_GetLastError
BD_GetLastErrDesc$():BD_GetLastErrDesc


Here's the latest build...

If you can, uninstall previous versions and use the installer for this one. I think everything is complete and works now, but I'd like someone to test it and make sure.

http://www.outergods.com/blitz/blitzdata12r8b.zip

And here's the "update" zip that has only the dll and decls file.

http://www.outergods.com/blitz/blitzdataupd.zip

Lemme know how it goes. If it works for you all I think I might call it finished and move on to my game again. :)

Kanati

(oh, and you'll note that the install has been cut down to 4 meg.)

Last update broke it!
BD_CloseQuery() causes error:
Object variable or with block variable not set (91)

GACK!!! That's because of the bookmark code I put in too. Crap.

Looking right now.

oops... Would have broke BD_ClearBookmark() too.

Fixed.

The blitzdataupd.zip file contains build 109. The blitzdata12r8b contains the full install rebuilt with fix.

Kanati

Works much better now. Thanks

I removed the Set and GetMaxRecords() commands I had added since you can set that in the query itself with "SELECT TOP XX". No need to overcomplicate things. But other than that I think this will be the final commandset for BlitzData. Anything else will probably be put on hold until I finish my game (unless I find I need it for the game itself) and version 2.0 at some indefinite time in the future (kinda like BlitzMax hehe :) )

So have at it... beat the snot out of it... and lemme know if you find any buggers.

Kanati

What about:
BDGetQueryTimeOut%()
BDSetQueryTimeOut%(Seconds%)

Not sure what would happen if I ran a long query.
Don't want it to error out.

8)

I think were damn close, if not there now.

I will look into that... It MIGHT make me revise the commandset but I've never had a query timeout, and I've ran it against a table with 3 million records. But POSSIBLY if you are doing a few joins.........

I'll look into it.

Kanati

ADO objects default to a 30 second command timeout, any command that takes longer will terminate the connection and the command.
Some queries take longer than 30 seconds, so it's nice to be able to adjust it up a bit to prevent the time out error, or set it to zero to take as long as it pleases.

CommandTimeout Property

Indicates how long to wait while executing a command before terminating the attempt and generating an error.
Settings and Return Values

Sets or returns a Long value that indicates, in seconds, how long to wait for a command to execute. Default is 30.
Remarks

Use the CommandTimeout property on a Connection object or Command object to allow the cancellation of a command due to delays from network traffic or heavy server use. If the time from the CommandTimeout property setting elapses prior to execution of the command, an error occurs and ADO cancels the command. If you set the property to zero, ADO will wait indefinitely until the execution is complete. Make sure the provider and data source to which you are writing code supports the CommandTimeout functionality.

For Connection objects, the CommandTimeout property is read/write.

When you use CommandTimeout on a Connection object, you set a global value for all commands executed and all recordsets opened on that connection. You can override this value for a specific command by setting the CommandTimeout property of the appropriate Command object.


Thanks for looking into it.

Wayne

Thank you again Kanati, for giving us a great tool to use with Blitz3d.

-Wayne

Unfortunately... The ONLY place I use the command object is in BD_SendSQLCommand() and I don't allow for it returning the single recordset that I give access to.

CommandTimeout and ConnectionTimeout aren't available to me in the recordset object (I use recset.Open "",...) to get the recordset. I can certainly change this but it would require me to rewrite almost all of my commands that use the recordset.

There's a lot of benefit to using the command object to return a recordset. Threre's a lot of options to run stored procedures and such.

So for now... I'm going to have to say no to the timeout thing. I will revist the issue though and rewrite the entire library.

Planned To Do:

Timeout implementation on queries, commands, connections
Metadata access
Here's the biggie... Multiple recordsets and connections.

But. I'm going to work on my game first so I'm thinking it's about 3 months out.

However, any bugs you find in this will be addressed promptly. Just let me know. I'll give it a few more days for any bugs found, and in the meantime I'll finish up docs. Make a few real demo programs for samples. And polish it up a bit before I release it in it's final form.

Kanati

Arghhhh no command object.

Yes, would be a rewrite, *smack* use command object next time. Let me know if you need any sample code or help with command object in the future.

8)

The default command timeout of 30 seconds will do for now.
At least we have blitzdata and SQL is possible now!

Looking forward to final release.

Thank you Kanatu, nice job bro!

Send me some email, or post a message on a new thread if you need any help testing, or need code donations for your game.

Also feel free to include any info, code samples, or connection strings I've posted into your final build.


-Wayne

Will do. I really didn't even think about using the command object in the beginning. When I do a rewrite I will most definitely use it as the "core" object type instead of the recordset.

Kanati

Kanati,

Could you tell me how I open a MS Access database? I mean what should I put in the BD_OpenDatabase function? I run the acces database local on the same pc I run blitzbasic, so I thought I don't have to supply a server, password or anything, just the path and name to the database and the type of database, but I keep getting an error.
Could you give me an code example on opening an MS Access database?

Thanks in advance,
Andrik

These links dont work anymore, anyone have these files? I will store them publicly on my server if I can get them.

Darkhalf,

You can find the files at:
www.sportbikemods.com/blitz/blitzdata14rc1.zip
www.sportbikemods.com/blitz/blitzdataupd.zip

I posted before you about how to use an MS access database, do you have any idea?

best regards,
Andrik