![]() Just create a simple Console Application under File->New Project->Visual C++->CLR and copy the the above code into the file where the main function is. OleDbDataReader^ reader = cmd->ExecuteReader (System::Data::CommandBehavior::CloseConnection) Ĭonsole::WriteLine ( "CategoryID: " + reader) Ĭonsole::WriteLine ( "CategoryName: " + reader + "\t") Ĭonsole::WriteLine ( "Description: " + reader) String^ sqlstr = "SELECT * FROM " Ĭonn = gcnew OleDbConnection ( "PROVIDER=.4.0 Data Source=C:\\Temp\\Northwind.MDB") #include "stdafx.h" #using #using #using using namespace System I'm aware C++ is not the best language for this particular program, but it is the language I went with for this project.Īny and all help will be greatly appreciated! I have read up on: (v=office.12).aspx, but cannot find anything conclusive and am not very experienced with this sort of coding. Like I said above, I have researched this as fully as I could before coming here to post. I am not trying to use the C++ program to write anything into the database, I'm only looking for a solution on how to read it and store it inside of C++. I'm simply looking for a way to have my C++ program connect to the database, read the data stored in each field, and store that data into its own variable. ![]() I'm aware of OLE DB, ADO, etc., but can't seem to grasp the best way to utilize them. I have been reading up a lot on the different ways to do this, but have not come across anything solid to help me. The part I'm having the most trouble with right now, is getting my C++ program to read that data from the DB and store it into variables. After storing said data, the VB program then opens up a C++ program which takes the data from the database and stores it into variables inside of C++ to use throughout the program. Reading the caveats on the Access Database Engine install (link in. I have created a VB program that takes data entered by a user and stores it into a Microsoft Access DB. When moving to the server use the 64 bit version. > In SQL Server Management Studio, connect to an instance of the SQL Server Database Engine. You can do dump the whole DB directly into another database, no need to store it into a temp file. What exactly it is I am trying to do is this: Using Server Management Studio (SSMS) Import and Export Wizard is straightforward. I have chosen to use C++ (which may not have been the best option for interacting with DB) and am struggling some trying to connect to the database I have created. I am currently working on a project for class that involves using programs to interact with a database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |