Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Best practice for data access within Dark SDK?

Author
Message
Clueless
20
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 31st Oct 2005 02:13
Hey all,

A new convert to Dark SDK here... absolutely love it so far, tons more versatility than my much beloved DBPro.

But I'm struggling with data access. I'm developing in Visual Studio 2003's C++ environment and for the life of me cannot find a simple example of database access using ODBC or ADO. Would really like to hear some ideas on the best way to do this.

All I want to do is open up a local MS Access database and read a set of records that define my scene -- which skybox to use, which buildings and roads to load, where to place enemy initially, etc. It's around 15 lines of code in Visual Basic.

Ideas, anyone?
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 31st Oct 2005 08:40
The easiest way would be to use the CRecordSet class - or if you want an easier life, Cattlerustler's SQL plug-in (which, whilst for DBPro, could be used in C), may offer MS Access, err, access..

Come to the third DarkBasic Pro Sci Fi Con - Less than 2 weeks to go!
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
Clueless
20
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 31st Oct 2005 23:39
Thankee Sarcasm Stealth Squad,

I'll dig into the CRecordSet class and C what I can find. (sorry about the pun, I was inspired by yours on offering Access access.)
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 1st Nov 2005 12:22 Edited at: 1st Nov 2005 12:23
I knew I had the code to my previous attempt to use CRecordSet - see http://forum.thegamecreators.com/?m=forum_view&t=4394&b=6
It will need converting slightly for DarkSDK use, but nothing too taxing.

Come to the third DarkBasic Pro Sci Fi Con - Less than 2 weeks to go!
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk
Clueless
20
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 1st Nov 2005 19:52
Sarcasm, you're a gentleman and a scholar... thanks much!!! Very generous of you to haved posted the source like that.
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 1st Nov 2005 21:27
I know

If it can be done in DBPro, I've probably done it. And if it cant be done, I probably have done it anyway

Come to the third DarkBasic Pro Sci Fi Con - Less than 2 weeks to go!
Blog:http://spaces.msn.com/members/BouncyBrick/
Web Site:http://www.nicholaskingsley.co.uk

Login to post a reply

Server time is: 2024-04-19 14:21:50
Your offset time is: 2024-04-19 14:21:50