* Re: Microsoft Access database on GNAT 3.04 [not found] <2gqo6.8730$925.800172@news6-win.server.ntlworld.com> @ 2001-03-04 12:59 ` David C. Hoos, Sr. 2001-03-04 14:05 ` Rohit Sharma 2001-03-09 5:32 ` DuckE 1 sibling, 1 reply; 9+ messages in thread From: David C. Hoos, Sr. @ 2001-03-04 12:59 UTC (permalink / raw) Gnat 3.04 is exceedingly old -- perhaps six years old. On what platform are you developing? You should probably upgrade to a newer compiler. For the latest GNAT compilers see ftp://ftp.cs.nyu.edu/pub/gnat/3.13p What's in the folder winnt will work on all win32 platforms. For Linux, you may prefer the rpms found at www.gnuada.org/ The above site also has some ports for platforms not covered by the nyu.edu site. There is information on accessing databases at www.adapower.com/os/odbc.html and www.adapower.com/reuse/iodbc.html "Rohit Sharma" <r.sharma.1998@cranfield.ac.uk> wrote in message news:2gqo6.8730$925.800172@news6-win.server.ntlworld.com... > Hi, > > Can anyone prvide ma an example of how to open a access database using ADA > (3.04). > > Thanks > Rohit > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Microsoft Access database on GNAT 3.04 2001-03-04 12:59 ` Microsoft Access database on GNAT 3.04 David C. Hoos, Sr. @ 2001-03-04 14:05 ` Rohit Sharma 2001-03-04 18:36 ` Gerhard Häring ` (2 more replies) 0 siblings, 3 replies; 9+ messages in thread From: Rohit Sharma @ 2001-03-04 14:05 UTC (permalink / raw) Hi, I am developing for Win 98/NT. I did get the 3.13 version which works very well with ADO for ODBC access, but the existing project is for a DLL (made in VC). The ADA provides the object files. The 3.04 version makes *.obj files but the 3.13 version makes *.o files whic dont seem to be compatible wit the rest of the project. Can you tell me what is the difference between *.O and *.OBJ files ? Thanks Rohit "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com> wrote in message news:l_qo6.154849$Ch.31226455@newsrump.sjc.telocity.net... > Gnat 3.04 is exceedingly old -- perhaps six years old. > > On what platform are you developing? You should > probably upgrade to a newer compiler. > > For the latest GNAT compilers see ftp://ftp.cs.nyu.edu/pub/gnat/3.13p > > What's in the folder winnt will work on all win32 platforms. > > For Linux, you may prefer the rpms found at > www.gnuada.org/ > The above site also has some ports for platforms not covered by > the nyu.edu site. > There is information on accessing databases at > www.adapower.com/os/odbc.html and > www.adapower.com/reuse/iodbc.html > > "Rohit Sharma" <r.sharma.1998@cranfield.ac.uk> wrote in message > news:2gqo6.8730$925.800172@news6-win.server.ntlworld.com... > > Hi, > > > > Can anyone prvide ma an example of how to open a access database using ADA > > (3.04). > > > > Thanks > > Rohit > > > > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Microsoft Access database on GNAT 3.04 2001-03-04 14:05 ` Rohit Sharma @ 2001-03-04 18:36 ` Gerhard Häring 2001-03-05 9:55 ` Tarjei T. Jensen 2001-03-06 13:26 ` WJT 2 siblings, 0 replies; 9+ messages in thread From: Gerhard Häring @ 2001-03-04 18:36 UTC (permalink / raw) Rohit Sharma wrote: > > Hi, > > I am developing for Win 98/NT. I did get the 3.13 version which works very > well with ADO for ODBC access, but the existing project is for a DLL (made > in VC). The ADA provides the object files. The 3.04 version makes *.obj > files but the 3.13 version makes *.o files whic dont seem to be compatible > wit the rest of the project. > > Can you tell me what is the difference between *.O and *.OBJ files ? I am not exactly an expert here, but .o is what GNU compilers (GNAT is the GNU Ada compiler) usually produce. .obj is usually produced by compilers on the Microsoft platform. MSVC isn't able to link .o files, but it is possible to use GNAT to link all your files to a DLL. The GNAT linker can read .o *and* .obj files. How to create DLLs with GNAT is described in the GNAT User's Guide. Gerhard -- Sorry for the fake email, please use the real one below to reply. contact: g e r h a r d @ b i g f o o t . d e web: http://highqualdev.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Microsoft Access database on GNAT 3.04 2001-03-04 14:05 ` Rohit Sharma 2001-03-04 18:36 ` Gerhard Häring @ 2001-03-05 9:55 ` Tarjei T. Jensen 2001-03-06 13:26 ` WJT 2 siblings, 0 replies; 9+ messages in thread From: Tarjei T. Jensen @ 2001-03-05 9:55 UTC (permalink / raw) Rohit Sharma wrote in message ... >Hi, > >I am developing for Win 98/NT. I did get the 3.13 version which works very >well with ADO for ODBC access, but the existing project is for a DLL (made >in VC). The ADA provides the object files. The 3.04 version makes *.obj >files but the 3.13 version makes *.o files whic dont seem to be compatible >wit the rest of the project. > >Can you tell me what is the difference between *.O and *.OBJ files ? Perhaps the files was created by the Aonix Ada compiler? BTW There might be tools available to convert .o to .obj files. Greetings, ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Microsoft Access database on GNAT 3.04 2001-03-04 14:05 ` Rohit Sharma 2001-03-04 18:36 ` Gerhard Häring 2001-03-05 9:55 ` Tarjei T. Jensen @ 2001-03-06 13:26 ` WJT 2001-03-07 6:31 ` Anders Wirzenius 2 siblings, 1 reply; 9+ messages in thread From: WJT @ 2001-03-06 13:26 UTC (permalink / raw) My friend, You wrote => > I am developing for Win 98/NT. I did get the 3.13 version which works very > well with ADO for ODBC access, but the existing project is for a DLL (made > in VC). I have used ADO/ODBC in Visual Basic and recently used ADO.Net in C# to get at an MS Access database but would like very much to use ADO/ODBC with Ada. Would you have a small snippit of code you could share with a poor old Ada programmer. A small example of connecting to an Access database, and loading up a Dataset with a SQL select statement would get me going. I can't belive it, after several years of hooking up with this news group I am finally asking for some help with code !!! WJT ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Microsoft Access database on GNAT 3.04 2001-03-06 13:26 ` WJT @ 2001-03-07 6:31 ` Anders Wirzenius 2001-03-07 14:24 ` rohit.sharma 0 siblings, 1 reply; 9+ messages in thread From: Anders Wirzenius @ 2001-03-07 6:31 UTC (permalink / raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 4255 bytes --] WJT wrote in message <982ogg$64t$1@tribune.oar.net>... ... >A small example of connecting to an Access database, and loading up a >Dataset with a SQL select statement would get me going. ... The following code is a result of modifying examples in the Samples directories in GNATCOM-1.3p for WinNT. Remove the HTML tags where they appear. The SQL is made using MS Access query builder, hence the unnecessary complexity of the SQL-command. Makefile: gnatmake -IC:\gnatcom-1.3p\binding -IC:\gnatcom-1.3p\samples\bindings -IC:\g natcom-1.3p\samples %1 -largs -lodbc32 Ada code: with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with GNAT.IO; use GNAT.IO; with GNATCOM.Types; with GNATCOM.BSTR; use GNATCOM.BSTR; with GNATCOM.VARIANT; use GNATCOM.VARIANT; with GNATCOM.Initialize; with ADO.uConnection_Interface; use ADO.uConnection_Interface; with ADO.uCommand_Interface; use ADO.uCommand_Interface; with ADO.uRecordset_Interface; use ADO.uRecordset_Interface; with ADO.Fields_Interface; use ADO.Fields_Interface; with ADO.Field_Interface; use ADO.Field_Interface; procedure Botnia is use type GNATCOM.Types.VARIANT_BOOL; Connection : uConnection_Type; Command : uCommand_Type; Recordset : uRecordset_Type; SQL : Constant GNATCOM.Types.BSTR := To_BSTR ( "SELECT Botniahalli.Botniahalli_Viite, Botniahalli.P�iv�m��r�, " & "Botniahalli.Alkaa, Botniahalli.Loppuu, Joukkueet.Joukkuenumero, " & "Botniahalli.Joukkue, Joukkueet.Joukkuenimi, " & "((Hour([Loppuu])-Hour([Alkaa]))*60+Minute([Loppuu])-Minute([Alkaa]))/30 " & "AS Vuoroja, " & "Int(((Hour([Loppuu])-Hour([Alkaa]))*60+Minute([Loppuu])-Minute([Alkaa]))/30 *[Hinta]+0.5) " & "AS Vuokra, KenttaVuokrat.KenttaNimi, Botniahalli.Botniahalli_Viite " & "FROM (Botniahalli INNER JOIN Joukkueet ON " & "Botniahalli.Joukkue = Joukkueet.Joukkuekoodi) " & "INNER JOIN KenttaVuokrat ON " & "Botniahalli.Kentt� = KenttaVuokrat.KenttaKoodi " & "WHERE (((Botniahalli.Botniahalli_Viite) Is Not Null) AND " & "((Joukkueet.Joukkuenumero)=144 Or (Joukkueet.Joukkuenumero)=152 Or " & "(Joukkueet.Joukkuenumero)=172))"); begin GNATCOM.Initialize.Initialize_COM; Put_Line ("Content-type: text/html" ); New_Line; Put_Line("<html><head><title>Anders</title>"); Put_Line("</head><body>"); Put_Line ("<B>Create ADO Engine</B><BR>"); Create (Connection, ADO.CLSID_Connection); Put_Line ("ADO Version is : <B>" & To_Ada (Get_Version (Connection))); New_Line; Put_Line ("</B>Open Connection to Database<BR>"); Put_ConnectionString (Connection, To_BSTR ("DSN=adademo") ); Open (Connection, null, null, null, 0); Create (Command, ADO.CLSID_Command); PutRef_ActiveConnection (Command, Pointer (Connection)); Put_CommandText (Command, SQL); Create (Recordset, ADO.CLSID_Recordset); Open (Recordset, Source => To_VARIANT_From_Dispinterface (Command), CursorType => ADO.AdOpenForwardOnly, LockType => ADO.AdLockReadOnly, Options => 0, Free => False); MoveFirst (Recordset); while Get_EOF (Recordset) /= GNATCOM.Types.VARIANT_BOOL_TRUE loop declare Fields : Fields_Type; begin Attach (Fields, Get_Fields (Recordset)); Put_Line ( "<P>" ); for N in 0 .. Integer (Get_Count (Fields)) - 1 loop declare Field : Field_Type; begin Attach (Field, Get_Item (Fields, To_VARIANT (N))); Put_Line (To_Ada (Get_Name (Field)) & " = <B>" & To_Ada (Get_Value (Field)) & "</B><BR>"); end; end loop; end; MoveNext (Recordset); New_Line; end loop; Put_Line ("Close Connections"); Put_Line("</body>"); Close (Recordset); Close (Connection); end Botnia; Another binding using ODBC you may find at Pascal Obry's home page http://perso.wanadoo.fr/pascal.obry/adas.html Hope this helps. Anders ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Microsoft Access database on GNAT 3.04 2001-03-07 6:31 ` Anders Wirzenius @ 2001-03-07 14:24 ` rohit.sharma 2001-03-08 6:03 ` Gerhard Häring 0 siblings, 1 reply; 9+ messages in thread From: rohit.sharma @ 2001-03-07 14:24 UTC (permalink / raw) [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 4723 bytes --] All these examples work very well with GNAT3.13 and GNATCOM-1.3. But I am looking for something under GNAT 3.04. Rohit "Anders Wirzenius" <anders.wirzenius@pp.qnet.fi> wrote in message news:1Bkp6.5$Sz3.1480@read2.inet.fi... > > WJT wrote in message <982ogg$64t$1@tribune.oar.net>... > ... > >A small example of connecting to an Access database, and loading up a > >Dataset with a SQL select statement would get me going. > ... > > The following code is a result of modifying examples in the Samples > directories in GNATCOM-1.3p for WinNT. Remove the HTML tags where they > appear. The SQL is made using MS Access query builder, hence the unnecessary > complexity of the SQL-command. > > Makefile: > > gnatmake -IC:\gnatcom-1.3p\binding -IC:\gnatcom-1.3p\samples\bindings -IC:\g > natcom-1.3p\samples %1 -largs -lodbc32 > > Ada code: > > with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; > with GNAT.IO; use GNAT.IO; > > with GNATCOM.Types; > with GNATCOM.BSTR; use GNATCOM.BSTR; > with GNATCOM.VARIANT; use GNATCOM.VARIANT; > with GNATCOM.Initialize; > > with ADO.uConnection_Interface; use ADO.uConnection_Interface; > with ADO.uCommand_Interface; use ADO.uCommand_Interface; > with ADO.uRecordset_Interface; use ADO.uRecordset_Interface; > with ADO.Fields_Interface; use ADO.Fields_Interface; > with ADO.Field_Interface; use ADO.Field_Interface; > > procedure Botnia is > use type GNATCOM.Types.VARIANT_BOOL; > > Connection : uConnection_Type; > Command : uCommand_Type; > Recordset : uRecordset_Type; > SQL : Constant > GNATCOM.Types.BSTR := To_BSTR ( > "SELECT Botniahalli.Botniahalli_Viite, > Botniahalli.P�iv�m��r�, " & > "Botniahalli.Alkaa, Botniahalli.Loppuu, > Joukkueet.Joukkuenumero, " & > "Botniahalli.Joukkue, Joukkueet.Joukkuenimi, " & > > "((Hour([Loppuu])-Hour([Alkaa]))*60+Minute([Loppuu])-Minute([Alkaa]))/30 " & > "AS Vuoroja, " & > > "Int(((Hour([Loppuu])-Hour([Alkaa]))*60+Minute([Loppuu])-Minute([Alkaa]))/30 > *[Hinta]+0.5) " & > "AS Vuokra, KenttaVuokrat.KenttaNimi, > Botniahalli.Botniahalli_Viite " & > "FROM (Botniahalli INNER JOIN Joukkueet ON " & > "Botniahalli.Joukkue = Joukkueet.Joukkuekoodi) " & > "INNER JOIN KenttaVuokrat ON " & > "Botniahalli.Kentt� = KenttaVuokrat.KenttaKoodi " & > "WHERE (((Botniahalli.Botniahalli_Viite) Is Not Null) > AND " & > "((Joukkueet.Joukkuenumero)=144 Or > (Joukkueet.Joukkuenumero)=152 Or " & > "(Joukkueet.Joukkuenumero)=172))"); > begin > GNATCOM.Initialize.Initialize_COM; > Put_Line ("Content-type: text/html" ); > New_Line; > Put_Line("<html><head><title>Anders</title>"); > Put_Line("</head><body>"); > > Put_Line ("<B>Create ADO Engine</B><BR>"); > Create (Connection, ADO.CLSID_Connection); > > Put_Line ("ADO Version is : <B>" & To_Ada (Get_Version (Connection))); > New_Line; > Put_Line ("</B>Open Connection to Database<BR>"); > > Put_ConnectionString > (Connection, > To_BSTR ("DSN=adademo") ); > > > Open (Connection, null, null, null, 0); > > Create (Command, ADO.CLSID_Command); > PutRef_ActiveConnection (Command, Pointer (Connection)); > > Put_CommandText (Command, SQL); > > Create (Recordset, ADO.CLSID_Recordset); > > Open (Recordset, > Source => To_VARIANT_From_Dispinterface (Command), > CursorType => ADO.AdOpenForwardOnly, > LockType => ADO.AdLockReadOnly, > Options => 0, > Free => False); > > MoveFirst (Recordset); > > while Get_EOF (Recordset) /= GNATCOM.Types.VARIANT_BOOL_TRUE loop > declare > Fields : Fields_Type; > begin > Attach (Fields, Get_Fields (Recordset)); > Put_Line ( "<P>" ); > for N in 0 .. Integer (Get_Count (Fields)) - 1 loop > declare > Field : Field_Type; > begin > Attach (Field, Get_Item (Fields, To_VARIANT (N))); > Put_Line (To_Ada (Get_Name (Field)) & " = <B>" & > To_Ada (Get_Value (Field)) & "</B><BR>"); > end; > end loop; > end; > MoveNext (Recordset); > New_Line; > end loop; > > Put_Line ("Close Connections"); > Put_Line("</body>"); > Close (Recordset); > Close (Connection); > end Botnia; > > Another binding using ODBC you may find at Pascal Obry's home page > http://perso.wanadoo.fr/pascal.obry/adas.html > > Hope this helps. > Anders > > ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Microsoft Access database on GNAT 3.04 2001-03-07 14:24 ` rohit.sharma @ 2001-03-08 6:03 ` Gerhard Häring 0 siblings, 0 replies; 9+ messages in thread From: Gerhard Häring @ 2001-03-08 6:03 UTC (permalink / raw) "rohit.sharma" wrote: > > All these examples work very well with GNAT3.13 and GNATCOM-1.3. But I am > looking for something under GNAT 3.04. Hmm, does my suggestion from above of using the linker of GNAT 3.13p for linking .o *and* .obj files not work? Gerhard -- Sorry for the fake email, please use the real one below to reply. contact: g e r h a r d @ b i g f o o t . d e web: http://highqualdev.com ^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Microsoft Access database on GNAT 3.04 [not found] <2gqo6.8730$925.800172@news6-win.server.ntlworld.com> 2001-03-04 12:59 ` Microsoft Access database on GNAT 3.04 David C. Hoos, Sr. @ 2001-03-09 5:32 ` DuckE 1 sibling, 0 replies; 9+ messages in thread From: DuckE @ 2001-03-09 5:32 UTC (permalink / raw) Tom Griest of LabTek used to produce the NT version of GNAT. As I recall that version required the use of the MS linker. Once ACT was formed and they decided that NT might be a viable platform to support after all, ACT started supporting NT directly. Check the web page: http://coba.shsu.edu/packages/ftp.cs.yale.edu/griest.html You might try contacting Tom. I hope this helps, SteveD "Rohit Sharma" <r.sharma.1998@cranfield.ac.uk> wrote in message news:2gqo6.8730$925.800172@news6-win.server.ntlworld.com... > Hi, > > Can anyone prvide ma an example of how to open a access database using ADA > (3.04). > > Thanks > Rohit > > ^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2001-03-09 5:32 UTC | newest] Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <2gqo6.8730$925.800172@news6-win.server.ntlworld.com> 2001-03-04 12:59 ` Microsoft Access database on GNAT 3.04 David C. Hoos, Sr. 2001-03-04 14:05 ` Rohit Sharma 2001-03-04 18:36 ` Gerhard Häring 2001-03-05 9:55 ` Tarjei T. Jensen 2001-03-06 13:26 ` WJT 2001-03-07 6:31 ` Anders Wirzenius 2001-03-07 14:24 ` rohit.sharma 2001-03-08 6:03 ` Gerhard Häring 2001-03-09 5:32 ` DuckE
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox