7 Replies - 11288 Views - Last Post: 27 February 2010 - 08:48 AM Rate Topic: -----

#1 jhobs_3526  Icon User is offline

  • New D.I.C Head

Reputation: -7
  • View blog
  • Posts: 14
  • Joined: 27-February 10

turbo c database connection

Posted 27 February 2010 - 05:18 AM

hey any proggramers out here? anybody who knows how to connect database in turbo c!please help!! how can i save database in turbo c? without lossing the data after turning the program off?please help please!!
Is This A Good Question/Topic? 0
  • +

Replies To: turbo c database connection

#2 sarmanu  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 966
  • View blog
  • Posts: 2,362
  • Joined: 04-December 09

Re: turbo c database connection

Posted 27 February 2010 - 05:27 AM

Skipping the part that Turbo C is probably older than you, what do you mean by Database? You mean a file containing useful informations created by your application at runtime?
Was This Post Helpful? 1
  • +
  • -

#3 Ferencn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 71
  • View blog
  • Posts: 322
  • Joined: 01-February 10

Re: turbo c database connection

Posted 27 February 2010 - 05:29 AM

Could you please repeat the question? I couldn't understand you the first three times... Lol
Was This Post Helpful? 1
  • +
  • -

#4 jhobs_3526  Icon User is offline

  • New D.I.C Head

Reputation: -7
  • View blog
  • Posts: 14
  • Joined: 27-February 10

Re: turbo c database connection

Posted 27 February 2010 - 05:32 AM

View Postsarmanu, on 27 February 2010 - 04:27 AM, said:

Skipping the part that Turbo C is probably older than you, what do you mean by Database? You mean a file containing useful informations created by your application at runtime?

reply!! i mean i want to know how to save database program in turbo c,i want to know how to connect the program in a database where i can retrieve the data i entered in turbo c
Was This Post Helpful? -1
  • +
  • -

#5 PlasticineGuy  Icon User is offline

  • mov dword[esp+eax],0
  • member icon

Reputation: 281
  • View blog
  • Posts: 1,436
  • Joined: 03-January 10

Re: turbo c database connection

Posted 27 February 2010 - 05:35 AM

1. Get a compiler that was released into this world before after you were.
2. What sort of database - online or offline?
3. Try to type properly.

EDIT: Oops. Thanks Jack.

This post has been edited by PlasticineGuy: 27 February 2010 - 07:28 PM
Reason for edit:: FTFY

Was This Post Helpful? 0
  • +
  • -

#6 jhobs_3526  Icon User is offline

  • New D.I.C Head

Reputation: -7
  • View blog
  • Posts: 14
  • Joined: 27-February 10

Re: turbo c database connection

Posted 27 February 2010 - 05:47 AM

View Postsarmanu, on 27 February 2010 - 04:27 AM, said:

Skipping the part that Turbo C is probably older than you, what do you mean by Database? You mean a file containing useful informations created by your application at runtime?



yap.how can i retrieve the in formations i entered during that run time?where can i see the files i entered?

View PostFerencn, on 27 February 2010 - 04:29 AM, said:

Could you please repeat the question? I couldn't understand you the first three times... Lol



reply!! i mean i want to know how to save database program in turbo c,i want to know how to connect the program in a database where i can retrieve the data i entered in turbo c,,yap.how can i retrieve the in formations i entered during that run time?where can i see the files i entered?
Was This Post Helpful? 0
  • +
  • -

#7 Munawwar  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 162
  • View blog
  • Posts: 457
  • Joined: 20-January 10

Re: turbo c database connection

Posted 27 February 2010 - 06:20 AM

If you created a file from your program as in fopen("file.txt","w") then the file is created in the current working directory...in windows its the same folder as your exe file (unless you changed the current working directory).
You can use fopen("file.txt","r") to open the file in read mode and use fgets or fscanf to read the contents of the file.
Was This Post Helpful? 0
  • +
  • -

#8 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: turbo c database connection

Posted 27 February 2010 - 08:48 AM

Without knowing more about what you are trying to do exactly (and seeing your effort to do it) it is really hard to help. In general one would use file IO to open a file, write data to it, close it. Then open the file again and read the data later. Now HOW you go about saving the data to disk is really going to be specific to your program. You might use a simple text format, or a CVS file, or XML, or maybe get into binary files and store records, maybe store the records in a tree, maybe store the records linearly, and then store an index as a tree... there are all kinds of ways to format data in a file and to help you would need to know what you are trying to do.

If you really have advanced requirement it might be worth your while to look at using a database API (though how that would work with an ancient compiler might be hard to figure out).

In general though, my best advice to you would be to get a newer compiler, there are MANY freely available compilers that are FAR better than Turbo C (which was a great compile 20 years ago). It will be much easier to help you on a modern compiler.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1