f



Tutorial; Accessing MS SQL Database using C++!

hey!

Im looking for a db tutoral which covers accessing a Microsoft SQL database
on windows. I will be using VC++ if it matters. NO details just a basic
introduction!

Oracle DB access using C++ is also of interest!

Thanks!

-- Majk

0
msa_pub (2)
9/6/2003 7:43:39 AM
comp.databases.ms-sqlserver 14567 articles. 1 followers. janinepelletier (108) is leader. Post Follow

1 Replies
1065 Views

Similar Articles

[PageSpeed] 30

majk <msa_pub@softhome.net> wrote in message news:<BB7F5CCB.6D61%msa_pub@softhome.net>...
> hey!
> 
> Im looking for a db tutoral which covers accessing a Microsoft SQL database
> on windows. I will be using VC++ if it matters. NO details just a basic
> introduction!
> 
> Oracle DB access using C++ is also of interest!
> 
> Thanks!
> 
> -- Majk

Both SQL Server and Oracle can be accessed by using various data
access API's, which are implemented on top of TDS (Tabular Data
Stream) protocol in SQL Server case and TNS (Transparent Network
Substrate) in Oracle case. Based on your choice of language I believe
you should look at examples how data is accessed using ODBC API in SQL
Server case and OCI (Oracle Call Interface) API in Oracle case.
Documentation and examples can be found on Microsoft's
http://msdn.microsoft.com/sql and Oracle
http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/nav/docindex.htm
Web sites. If you develop managed application for .NET Framework you
have a choice of using .NET managed providers for SQL Server and
Oracle, which are much easier to program then ODBC and OCI. Hope this
helps.

Sinisa Catic
0
9/6/2003 3:56:33 PM
Reply:

Similar Artilces:

export sqlserver database to ms-access by sql script
Hi Is there anyway to export a sqlserver database to ms-access through a sql scipt only without using the sql enterprise manager. -- Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server-general/200601/1 ...

How to interact with Oracle, MS-SQL and Sybase databases using C Language
How to interact with Oracle, MS-SQL and Sybase databases using C Language. Please provide me information about links or books which discuss this subject yogishaj wrote: > How to interact with Oracle, MS-SQL and Sybase databases using C > Language. Please provide me information about links or books which > discuss this subject > You can use a database library, such as ODBC, or you can use Embedded SQL. A simple google search on either of those terms will give you the information you need. Jon ---- Learn to program using Linux assembly language http://www.cafeshops.com/bartle...

Create MS/ACCESS database app for non-ms/access users
Is it possible to create an MS/ACCESS database application and package it for users who do not have MS/ACCESS loaded in their PCs? I was told that this is possible, but I don't know what software is needed. Do you know? If so, please answer this post. Thanks. SueB *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! Per Sue Bricker: >Is it possible to create an MS/ACCESS database application and package >it for users who do not have MS/ACCESS loaded in their PCs? > >I was told that this is possible, but I don't know what software is >needed. Do you know? If so, please answer this post. Thanks. I think it comes down to semantics. "Licensed" vs "Loaded". No you can't create an app that will run on a PC with nothing loaded. Yes you can create an app that will run on a PC where nobody's paid the fee to run MS Access. You still have to install something on that PC, however. What it is is a freebie version of MS Access that only runs applications - doesn't allow anybody to develop an app. You develop the app on your PC, which has MS Access installed. Then somebody installs the freebie ("Runtime Access") on somebody's PC and they can run the app you developed without having to pay any money to anybody. -- PeteCresswell Sue, If Access isn't present, some version of it must be installed to run an Access database. VB.NET, ...

Accessing MS ACCESS database using Data Environment
HI, I have developped a program in Visual Basic 6.0 using MS Access database. I have created all my reports through Data Environment where I have entered the location of my database file (for e.g c:\project\app\test.mdb) in the Connection properties. I have installed my application on another PC using Package & Deployment wizard. When viewing the reports on the other PC, I have to enter everytime the new location of the database. How can I solve this problem, please? nadia wrote: > HI, > I have developped a program in Visual Basic 6.0 using MS Access database. >...

access MS-Access database in C# Windows Application
Hi, I am trying to access the MS Access database on my local machine in C# Windows Application in Visual Studio.NET. But it seems that it does not work. I use the Microsoft Application Blocks to access the database. I have tried 2 possible connection strings. ----------------------------------------- str_1 = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" + DBFilePath; str_2 = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + DBFilePath; //SqlHelper is the class in the Microsoft Application Blocks SqlHelper.ExecuteNonQuery( str_1, CommandType.Text, SQL_str); ----------------------------------- The error message I got is: "Unknown connection option in connection string: driver." for str_1 and " Unknown connection option in connection string: provider." for str_2 So I am wondering, where is the problem? Is it because my connection string for MS Access is specified wrongly? Or is it because I cannot use SqlHelper to access the MS Access database? ( I have used SqlHelper class to access the MS SQL server, and it works) Your help will be greatly appreciated. James James wrote: > Hi, I am trying to access the MS Access database on my local machine > in C# Windows Application in Visual Studio.NET. > > But it seems that it does not work. I use the Microsoft Application > Blocks to access the database. > > I have tried 2 possible connection strings. > > ----------------------------------------- > ...

Possible to keep MS Access interface and migrate the MS Access to MS SQL Server?
Hello all Would it be possible to migrate the MS Access 2000 to MS SQL Server 2000? My application is using MS Access 2000 as database and as user interface such as forms. Now, I want to migrate the backend database from MS Access 2000 to MS SQL Server 2000. However, I want to keep the MS Access 2000 interface. Would it be possible? If I migrate the MS Access to SQL Server, would the queries, back-end VBA, macro, tables and forms be affected? Do I need to change the MS Access data type to SQL server supported data type? Which tool I can use to do the migration? Upsizing wizard or exporting the Access database and then importing it to the SQL server? Thanks in advance Cheers Bon This is somewhat easy. Basically you need to port or transfer your Access tables to a SQL DB and then link the Access DB/App. to the SQL tables on the SQL Server. If you keep the table names the same, the code etc shouldn't need altering, bu I would test it first. db55 wrote: > This is somewhat easy. > > Basically you need to port or transfer your Access tables to a SQL DB > and then link the Access DB/App. to the SQL tables on the SQL Server. > If you keep the table names the same, the code etc shouldn't need > altering, bu I would test it first. > If only it were that easy :-) Bon wrote: > Hello all > > Would it be possible to migrate the MS Access 2000 to MS SQL Server > 2000? > > My application is using MS Access 2000 as database and a...

Problems with MOD-Function by accessing MS-Access Database via SQL in Delphi
Hello, the following problem: I use Delphi 6 to access a MS Access Database. In short, the Delphi Code looks like this: ADOConnection1.Open; ADOQuery1.Close; ADOQuery1.SQL.Text :=3D 'SELECT * FROM database1 WHERE value1=3D1 AND value2=3D ' + inttostr(array[3]); ADOQuery1.Open; Label5.Caption:=3DADOQuery1.Fiel=ADdByName('value4').AsString; Now I only want to select these rows, where the Integer value3 ends on 1=2E So I need the Modulo-Function. I found in the Internet these two functions: MOD(x,y) und x % y But I get an error if I want to use one. For example, If I change ADOQuery1.SQL.Text :=3D 'SELECT * FROM database1 WHERE value1=3D1 AND value2=3D ' + inttostr(array[3])+' AND MOD(value3,10) =3D 1; Delphi shows me a Syntax Error in this statement. Thx for help! Sorry, there is a ' missing in the code. But it has nothin to do with the problem: The first code runs perfectly, but If I insert AND MOD(20,10) = 0 there is the syntax error again. On 23 Aug 2005 11:51:15 -0700, sarah18web wrote: > Sorry, there is a ' missing in the code. But it has nothin to do with > the problem: > > The first code runs perfectly, but If I insert > AND MOD(20,10) = 0 there is the syntax error again. Don't know what it might have to do with Delphi; but MOD() is not a function supported by SQL server. Only the % operator works. ...

MS-Access, ODBC access with Visual C++ 6.0, and external actions on database
[was redirected here] I have a problem that I can distill down to the following. 1/ A Visual C++ 6.0 program connects to a MS Access database using an ODBC connection and sleeps for a long time. The connection takes all defaults and uses CDatabase::useCursorLib in the OpenEx command. 2/ The database is well over 400MB large with over 200 tables and is compacted. 3/ Another process starts a winzip on that database that takes about 45 to 60 seconds to complete (wzzip -a -ex aaa.zip aaa.mdb). 4/ The Windows Task Manager shows 100s of MBs of available memory being consumed....

MS Access database with a file extension of .mde
Good day: Can you kindly assist me in opening a MS Access database with a file extension of .mde? I get an error message stating "This database is in an unrecognized format". Any help is greatfull. TIA This usually indicates an attempt to open an Access 2000 database in an earlier version. -- MichKa [MS] NLS Collation/Locale/Keyboard Development Globalization Infrastructure and Font Technologies This posting is provided "AS IS" with no warranties, and confers no rights. "mary" <chloemelmom@yahoo.com> wrote in message news:a0a64947.0311151242.4df0c8a3@posting.google.com... > Good day: > > Can you kindly assist me in opening a MS Access database with a file > extension of .mde? > > I get an error message stating "This database is in an unrecognized > format". > > Any help is greatfull. > > TIA "mary" <chloemelmom@yahoo.com> wrote in message news:a0a64947.0311151242.4df0c8a3@posting.google.com... > Good day: > > Can you kindly assist me in opening a MS Access database with a file > extension of .mde? > > I get an error message stating "This database is in an unrecognized > format". > > Any help is greatfull. > > TIA Best place to get answers is at the official MVP site: http://mvp.org Robyn Schulz, MVP A) That url isn't. B) If that's the best place to get answers, why do you hang out in a newsgroup designed to give ...

using a remote MySQL Database in MS Access
Hello Probably, this is a beginners question, but I am stuck on it. I am trying to use a MYSQL Database on a remote server from inside an MS Access program. Therefore I have to create an ODBC data source. Now is my question: Where can I do this. I suppose it is the Windows Start | Control Panel | Admin Tools | Data Sources menu, but there, I cannot find what selections I have to make for a remote MySQL Database. I don't have a "MySQL" driver or something. Thanks for any help. LR lucky wrote: > Hello > > Probably, this is a beginners question, but I am stuck on it. > I am trying to use a MYSQL Database on a remote server from > inside an MS Access program. > > Therefore I have to create an ODBC data source. > Now is my question: Where can I do this. > > I suppose it is the Windows Start | Control Panel | Admin Tools | Data Sources > menu, but there, I cannot find what selections I have to make for a remote > MySQL Database. I don't have a "MySQL" driver or something. Go to Google.com & enter the following as a search string: "mysql driver" You get thousands of references. -- MGFoster:::mgf00 <at> earthlink <decimal-point> net Oakland, CA (USA) ...

MS Access & SQL Database for JPEGS
I'm trying to create a web accessed JPEG database for all of my p 0 r m pics. Anybody know where to start? The site I'm interested in putting in an Access database is at the link below: Don't click on this link unless you want to be seriously offended. http://www.tubgirl.com ...

copying data from MS-SQL to MS-Access using VB.Net
Hi there, I'm trying to use MSAccess as a "container" to move data around from one MS-SQL server DB to another. This is basically already a design decision that has been made for a lot of reasons and can't be changed by me. What I was wondering is what is the bet way to populate the MS-Access DB. The DB will only contain 6 tables which will have a very small amount of data in them. I have tried to use ADO.Net to read the data from MS-SQL into a DataTable and then save it into the MS-Access DB using again using a DataTable populated from the first, but I can't seem to ge...

MS Access Script to import data from external mde database to mdb database
Hi, Does anyone know of a way I can write a script that imports a table from a particular .mde file? I don't seen any obvious way to do it as a macro. Any suggestions if it can be done as a macro or as a written module? My ultimate goal is to have script that clears info out of 1 table in an .mdb file, imports an identically structured table from a .mde file, runs an append query I have in place to copy the data from the imported table to the table in my.mbd file, and then delete the imported table. Any help that could be provided would be greatly appreciated. Best wishes, George Hadley ghadley_00@yahoo.com With DBEngine(0)(0) .Execute "DELETE * FROM Suppliers WHERE SupplierID IN (SELECT SupplierID FROM Northwind.mde.Suppliers)" .Execute "INSERT INTO Suppliers SELECT * FROM Northwind.mde.Suppliers" End With Is this code I would run as a module? Yes or you could use the strings in two separate saved queries. ...

Trouble when submitting sql-query to MS Access Database
Hi, I have some problems when trying to submit a simple insertion statement to a MS Access Database. The reading is fine, but when I want to execute an insertion statement using the following code: public void SQLCommand(String sql) throws SQLException { connection = DriverManager.getConnection(database); Statement stmt = connection.createStatement(); stmt.executeUpdate(sql); connection.close(); } gives the following error: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1. at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source) at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(Unknown Source) at sun.jdbc.odbc.JdbcOdbcStatement.execute(Unknown Source) at sun.jdbc.odbc.JdbcOdbcStatement.executeUpdate(Unknown Source) at org.strumpflohner.CodeNotebook.Data.DBManager.SQLCommand(DBManager.java:45) at org.strumpflohner.CodeNotebook.Data.TestClass.main(TestClass.java:15) Could someone help me? kito Suggestion 1: The error is caused because you're referring to a table that does not exist. Try to run the query in a seperate query editor and verify that it does work. Also check that the string you pass as argument is correct, e.g. not concatenation that has destroyed the intended string. Suggestion 2: You probably need to add quotes in the executeQuery. Whenever you pass a string to a database try to inclose the statement with...

Export relations from SQL Server Database to MS Access
Hi I have to make export of SQL Server Database to MS Access and I have done it with the tables but now I need to transfer(export) the relations, keys and indexes. Can any1 tell me how to read relations,keys and indexes from SQL Server and convert them to MS Access.(it seams that for creation of indexes in MS Access ADOX is the only way but ADOX cannot read all information about keys,indexes from SQL Server.) All I can see is that I have to use SQLDMO to enumarate all realtion/keys/indexes from SQL Server database and use ADOX to create this relations/keys/indexes in MS Access database, but I don't know exact matching attributs of relations/keys/indexes from SQL to Access. Thanks Hi You posted the same question in microsoft.public.sqlserver.programming. If you are not sure about the answers you were given then please do not cross post. John "Bose" <bosejob@sympatico.ca> wrote in message news:ztBFc.97111$Ax1.1377116@news20.bellglobal.com... > Hi > I have to make export of SQL Server Database to MS Access and I have > done it with the tables but now I need to transfer(export) the > relations, keys and indexes. Can any1 tell me how to read relations,keys > and indexes from SQL Server and convert them to MS Access.(it seams that > for creation of indexes in MS Access ADOX is the only way but ADOX > cannot read all information about keys,indexes from SQL Server.) > All I can see is that I have to use SQLDMO to enumarate ...

Adding records to a SQL Server database from MS Access
Thanks in advance for your help. I have just upsized an Access database to SQL Server with the hope of using a fairly extensive Access application that was part of it. But now, the forms will not allow the addition of new records (the >* button is greyed out). The forms use a macro to advance the dataset to a new record. How can I get the additions (inserts) turned back on? Regards. ...

How to get MS SQL database size using API
Hi, How to get MS SQL database size using API. On 18 ao=FBt, 13:14, "mathu...@gmail.com" <mathu...@gmail.com> wrote: > =A0 =A0How to get MS SQL database size using API. Use, for example, ADO to connect to the database, like in the sample from KB220152 Then call "sp_spaceused" and the second returned value will be the database size. ...

how do you update a java.sql.date type in an ms access database
when i update a row in an access database the date field does not update to the correct date it brings up some funny date which i dont know where it comes from. Below is the method i use to update. maybe the date types are not compatable? thanks in advance, public static void bookIN(int custID, int rNumber,java.sql.Date bkInDate ){ try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); String filename = "hotelDB.mdb"; String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="; database+= filename.trim() + ";DriverID=22;READONLY=true}"; Connection con = DriverManager.getConnection( database ,"",""); int yes = 1; Statement s = con.createStatement(); s.executeUpdate("update Rooms set CustomerId ="+custID+",BookINDate ="+ bkInDate +",Occupied = "+yes+" where RoomNo = "+rNumber+" "); s.close(); con.close(); } catch (Exception err) { System.out.println("ERROR: " + err); } } "chose" wrote... > when i update a row in an access database the date field > does not update to the correct date it brings up some > funny date which i dont know where it comes from. It comes from db's attempt to parse an invalid date-string... In Access/Jet,...

Wanted: Programmer to modify MS Access database for web use
I have a Microsoft Access database I'd like to have completed. I need forms added to add, delete and modify customers, sales and products. If you can also do the additional modifications to interface to my website then that would be a bonus. ...

Php and DataBase Abstraction for mySql, Sql Server, and MS Access?
Is there a good DataBase Abstraction layer that will handle the mySql, Sql Server, and MS Access engines? I do not wish to write the same functions with the three different PHP db functions. I see that php_dba is listed as an extension, but I determine which DBs are supported. However, I think that it does not support the ones I need. Thanks David wrote: > Is there a good DataBase Abstraction layer that will handle the > mySql, Sql Server, and MS Access engines? I do not wish to write the > same functions with the three different PHP db functions. > > I see that php_...

Is this possible? please help (MS access query of sql database)
I work for an organisation that uses a bespoke document imaging system, the database of which is an MS sql server. We have MS Access and already use it for some querying of the database. The database comprises a large number of distinct cases, which are differentiated by case reference numbers, in one field (table?) of the database. Each of these cases may have many documents associated with it, denoted by the reference number, and these documents may be "new", "pending" or "complete" shown in another data field. We need to know how many cases have work outstanding on them. Our problem is that our bespoke software will only count the number of documents of each status, and not the cases. Is it possible to design an MS Access query which will count the number of different reference numbers which have any "new" documents associated, but wont count each case more than once? I am reasonably computer-savvy, I just don't know Access or SQL.. If I know it is possible, I don't mind putting in the effort to find out how. I just don't want to waste time barking up the wrong tree ;-) Of course any advice about how this would be achieved, such as pointers to the right parts of the MS Access helpfiles, or to relevant websites would be greatly appreciated. Some quick code would be even better... Also, if there is any 3rd-party software which could easily do this, I need help discovering it...I have looked long and hard, but don't k...

Re: Accessing MS SQL server or ORACLE database from the HP3K
Folks, One small clarification to my previous question: We are not trying to migrate our IMAGE data to another platform. We are trying to provide an enhancement where data that already exist in a database on another platform can be viewed, extracted and used to "complete" an existing entry in the IMAGE database, thus eliminating the need for the user to manually 're-enter' the data. Regards Paul Christidis =============================================================================== Folks, I was asked the following question today and decided to turn to y...

Import MS Office Excel Comma Separated Values Files into a MS Access 2003 database
Hi, I have been tasked with Importing MS Office Excel Comma Separated Values Files into a MS Access 2003 database. These files were exported from a DB2 database.I have also been given the DDL code. I have Googled a solution to this task and have tried creating these tables using the DDL code in a query within a blank MS Access database. Is there a more expedient way to achieve this? I noticed, for example, that a field in DB2 has a data type of "decimal" while the same field would have the data type of "number". Thanks, Zuf What follows is the DDL: -------...

How to set Data source in MS Word as MS Access Databases via DDE(*.mdb;*.mde).
How to set Data source in MS Word as MS Access Databases via DDE(*.mdb;*.mde). Everytime i click the command button to merge the data, it gives me item not found and i know that its a problem with my datasource. when i click ok then it opens the word doucment prompting me which datasource you want to use, when i click DDE then it gives me the merged data. Is there anyway i can set it permanantely in my codes below. Private Sub SetQuery(strQueryName As String, strSQL As String) On Error GoTo ErrorHandler 'set the query from which the merge ' document will pull its i...

Web resources about - Tutorial; Accessing MS SQL Database using C++! - comp.databases.ms-sqlserver

Resources last updated: 3/22/2016 10:53:13 AM