473,473 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Basic c++ and database interaction questions

I have a noob problem that is fairly expansive. Let me preface it by
saying that I'm a beginning programmer and am using the game I'm
writing as a learn-as-I-go tool. I'm trying to make a
sports-management game that pulls extensive team and player data from
a database to simulate matches and such. I'm not really clear on what
would be a good database to use and the process of accessing it. My
criteria is the following -
1 - The user shouldn't have to install any services outside of the
setup package - basically my parents should be be able to install and
run it
2 - I would like it to be OS (Linux, Windows) independent, though I
think that's probably wishful thinking

I currently have MS-SQL server setup and am using MS-VC++ 6 (the
application is a console app however), but I'm not really clear how to
go about connecting to it. I was looking at using ADO but that sounds
like it's a Microsoft specific way of doing it.
On top of that problem, I really have no idea what I'm doing as far as
what libraries I should include and the function calls to make. I've
googled for the last couple of days looking for a tutorial or anything
that could guide me through it and even went to the local techie book
store without any luck. If anyone can point me towards a walkthrough
or provide insight I would really appreciate it, even if it's to go
RTFM - just tell me where the FM is. =)
Jul 22 '05 #1
8 2028
Jasper wrote:
I have a noob problem that is fairly expansive. [...]
I currently have MS-SQL server setup and am using MS-VC++ 6 (the
application is a console app however), but I'm not really clear how to
go about connecting to it.
This is not a C++ language issue. Try asking in a VC++ newsgroup
or in a MS SQL server newsgroup.
I was looking at using ADO but that sounds
like it's a Microsoft specific way of doing it.
It probably is, so? You need to connect two Microsoft products.
Why not use a Microsoft way of doing it?
On top of that problem, I really have no idea what I'm doing as far as
what libraries I should include and the function calls to make.
And on top of that, you have no idea where to post your questions
either. Start by reading the Welcome message posted here weekly
and the FAQ.
I've
googled for the last couple of days looking for a tutorial or anything
that could guide me through it and even went to the local techie book
store without any luck. If anyone can point me towards a walkthrough
or provide insight I would really appreciate it, even if it's to go
RTFM - just tell me where the FM is. =)


Visit www.amazon.com and look for Microsoft SQL server programming.
For starters, I mean. Before you even ask anything in a Microsoft
newsgroup, that is.

Here it's all off-topic.

Victor
Jul 22 '05 #2
Actually it is C++, not VC++ since it's a console app. If it makes
you feel better I can say that I'm writing it with Bloodshed Dev-C++
which is what I started it on. Second, I didn't say I was set on
MS-SQL server, on the contrary I don't think it's what I need. I've
been pointed towards mySQL by people who read (and understood) my post
before responding. So where is the relevance of this being posted in
an MS specific newsgroup, especially when I clearly stated I was
looking for a solution that was OS independent?
And thanks for the amazon link, I guess I forgot to mention that I
already browsed through Powell's Tech for an hour or so and didn't see
any books that were specifically targetted at C++ and SQL interaction.
All the SQL books I found were specifically aimed at setting up and
querying the database, which I already own books for. Oh wait, I did
mention it.
If it's a failure on my part to communicate what I was asking for
correctly, I apologize, though I would have preferred you not to
answer if you didn't understand. Thanks!
On Fri, 11 Jun 2004 12:43:13 -0400, Victor Bazarov
<v.********@comAcast.net> wrote:
Jasper wrote:
I have a noob problem that is fairly expansive. [...]
I currently have MS-SQL server setup and am using MS-VC++ 6 (the
application is a console app however), but I'm not really clear how to
go about connecting to it.


This is not a C++ language issue. Try asking in a VC++ newsgroup
or in a MS SQL server newsgroup.
I was looking at using ADO but that sounds
like it's a Microsoft specific way of doing it.


It probably is, so? You need to connect two Microsoft products.
Why not use a Microsoft way of doing it?
On top of that problem, I really have no idea what I'm doing as far as
what libraries I should include and the function calls to make.


And on top of that, you have no idea where to post your questions
either. Start by reading the Welcome message posted here weekly
and the FAQ.
I've
googled for the last couple of days looking for a tutorial or anything
that could guide me through it and even went to the local techie book
store without any luck. If anyone can point me towards a walkthrough
or provide insight I would really appreciate it, even if it's to go
RTFM - just tell me where the FM is. =)


Visit www.amazon.com and look for Microsoft SQL server programming.
For starters, I mean. Before you even ask anything in a Microsoft
newsgroup, that is.

Here it's all off-topic.

Victor


Jul 22 '05 #3
Jasper wrote:
[...]
If it's a failure on my part to communicate what I was asking for
correctly, I apologize, though I would have preferred you not to
answer if you didn't understand. Thanks!


C++ _language_ has no means to communicate with any databases.
It's all done through libraries supplied by database vendors or
by third parties. Discussing programming issues with those
libraries is beyond the scope of this newsgroup.

If I didn't make myself clear in my first reply, I apologize,
though I would have preferred you not to post off-topic crap here
in the first place, but you probably already knew that. Thanks!
Jul 22 '05 #4
Jasper wrote:

I have a noob problem that is fairly expansive. Let me preface it by
saying that I'm a beginning programmer and am using the game I'm
writing as a learn-as-I-go tool.
Games are excellent learning tools.
I'm trying to make a
sports-management game that pulls extensive team and player data from
a database to simulate matches and such. I'm not really clear on what
would be a good database to use and the process of accessing it. My
criteria is the following -
1 - The user shouldn't have to install any services outside of the
setup package - basically my parents should be be able to install and
run it
2 - I would like it to be OS (Linux, Windows) independent, though I
think that's probably wishful thinking


I'd say a text-based flat-file system would fit the needs here. How much
information are we talking about? You'd be surprised (pleasantly) at how
quickly a C++ app can chug through a data file with current hardware. If
there isn't too much, you can probably load all the data records into
memory. I'd look at something like line-separated records with
tab-separated data fields.

A relational database like you mention in stuff I am going to snip is
another way to go, IF your goal is to learn SQL or some other query
language. If not, and you want to learn C++, then don't get wrapped up
with the other thing.

I'd write it as a straight 100% ISO standard C++ program at the
beginning. That gives you maximum portability. Later you can look at
enhancements that may be platform specific (which would be off-topic
here).

I hope this helps. You'd need to define your class hierarchy for the
game elements and decide on your data record structure. That's not
really topical here either, perhaps comp.programming, but once you get
that we can certainly help with implementation.

Brian Rodenborn
Jul 22 '05 #5
Jasper wrote:
2 - I would like it to be OS (Linux, Windows) independent, though I
think that's probably wishful thinking


http://www.trunet.dk/~db/C++.html
For database access you can use dbconnect or wxDB from wxWidgets

br
db
Jul 22 '05 #6
Thanks a ton to both Daniel and DU. You gave me a lot to think about
and gave me an FM to read. =) I appreciate it.

On Sat, 12 Jun 2004 00:01:01 +0200, Daniel Blankensteiner
<db@XXXXXTruNet.dk> wrote:
Jasper wrote:
2 - I would like it to be OS (Linux, Windows) independent, though I
think that's probably wishful thinking


http://www.trunet.dk/~db/C++.html
For database access you can use dbconnect or wxDB from wxWidgets

br
db


Jul 22 '05 #7
Jasper wrote:
I have a noob problem that is fairly expansive. Let me preface it by
saying that I'm a beginning programmer and am using the game I'm
writing as a learn-as-I-go tool. I'm trying to make a
sports-management game that pulls extensive team and player data from
a database to simulate matches and such. I'm not really clear on what
would be a good database to use and the process of accessing it. My
criteria is the following -
1 - The user shouldn't have to install any services outside of the
setup package - basically my parents should be be able to install and
run it
2 - I would like it to be OS (Linux, Windows) independent, though I
think that's probably wishful thinking


I think what would work for you is SQLite:

http://www.sqlite.org/

It is freeware and has a very simple API. It does not run as a
service like MySQL or MS SQL, and the whole database is stored in a
single file. You should be able to find sample code in Google and by
reading the documentation.
Jul 22 '05 #8
On Fri, 11 Jun 2004 16:37:50 UTC, Jasper <ja******@comcast.net> wrote:
I have a noob problem that is fairly expansive. Let me preface it by
saying that I'm a beginning programmer and am using the game I'm
writing as a learn-as-I-go tool. I'm trying to make a
sports-management game that pulls extensive team and player data from
a database to simulate matches and such. I'm not really clear on what
would be a good database to use and the process of accessing it. My
criteria is the following -
1 - The user shouldn't have to install any services outside of the
setup package - basically my parents should be be able to install and
run it
2 - I would like it to be OS (Linux, Windows) independent, though I
think that's probably wishful thinking

I currently have MS-SQL server setup and am using MS-VC++ 6 (the
application is a console app however), but I'm not really clear how to
go about connecting to it. I was looking at using ADO but that sounds
like it's a Microsoft specific way of doing it.
On top of that problem, I really have no idea what I'm doing as far as
what libraries I should include and the function calls to make. I've
googled for the last couple of days looking for a tutorial or anything
that could guide me through it and even went to the local techie book
store without any luck. If anyone can point me towards a walkthrough
or provide insight I would really appreciate it, even if it's to go
RTFM - just tell me where the FM is. =)


Jasper,

I agree with Brian that the best method, especially for a learn as
you go project, might be to code the database portion yourself. It
all depends on what you want and need. Judging from your post, I'd
say you don't know what kind of database is needed and have just
used and mentioned a few that people know about.

Another option for a C based database program is from FairCom and
I think it was called c-tree. The cost a few years ago was about
$300. I was given the DB Admin job for their databases. Anyway
you get the full source code and they support a couple dozen
systems. Beats the price of most other products any day. There
are also some public domain light databases but I don't know any
off the top of my head.

Unless you have an absolutely huge amount of data to play with,
or truely need a relational database, or need to access said
database with outside tools, its not worth it to bother. Writing
it all yourself will keep it portable, fast, and a slightly better
learning experience.

David
Jul 22 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: nib | last post by:
What kind of problems is visual basic best at solving?
2
by: Steven O. | last post by:
First, this may not be the correct newsgroup. I have some relatively basic questions on SQL. I tried to find a newsgroup that was specifically just about SQL, and was surprised to find that all...
8
by: Grant Schenck | last post by:
Hello, I'm pretty new to C# and .NET. I've been tasked with creating an Internet Explorer toolbar. I implemented it and it works OK, however, because the toolbar has a notion of having to...
2
by: Fay Yocum | last post by:
BEWARE beginner questions!! I have some experience in Access but never as much as I want or need. I have decided to get in on VB.Net. I would only rate myself in Access as a...
8
by: windandwaves | last post by:
Hi Folk I want to send out a basic newsletter from my MySql database of contacts. Does anyone know a nice and simple bit of PHP that allows me to do this? TIA - Nicolas
3
by: Miro | last post by:
Ok im a newbie to VB, and am having some trouble reading msdn help / or how it all links together. My books are either missing a step / or assume everything is set up correctly. I know about...
28
by: Randy Reimers | last post by:
(Hope I'm posting this correctly, otherwise - sorry!, don't know what else to do) I wrote a set of programs "many" years ago, running in a type of basic, called "Thoroughbred Basic", a type of...
3
by: Monroeski | last post by:
We have an MS Access database that we are using at my work. Currently, everything is done through forms in Access, but this makes making any updates to the forms difficult, as there is always...
3
by: mmm | last post by:
I am looking for advice on Python Editors and IDEs I have read other posts and threads on the subject and my two questions at this time are mainly about the IDLE-like F5-run facilities. While I...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.