|
|||
|
Hi,
Recently I've started converting our xharbour applications so that they will use a MS SQL database rather than dbf's. On my laptop everything works fine so far, I use the Microsoft SQL server management studio express (2005). Setting up an ODBC connection was relatively easy. However, if I try to connect to our main MS SQL server (SBS 2003) via TCP IP, I seem to be unable to even set up an ODBC connection. Does anybody have an example of setting for both client and server side that have to be used to accomplish this task? Thanks in advance. Gerard |
|
|
||||
|
||||
|
|
|
|||
|
On 1 Apr, 14:57, "Gerard" <codg...@yahoo.com> wrote:
> Hi, > > Recently I've started converting our xharbour applications so that they will > use a MS SQL database rather than dbf's. On my laptop everything works fine > so far, I use the Microsoft SQL server management studio express (2005). > Setting up an ODBC connection was relatively easy. > > However, if I try to connect to our main MS SQL server (SBS 2003) via TCP > IP, I seem to be unable to even set up an ODBC connection. Does anybody have > an example of setting for both client and server side that have to be used > to accomplish this task? Thanks in advance. > > Gerard Are you using sqlrdd? either Mediator and sqlrdd have a good product for convert an existing application sqlrdd is royaltyfree but require a subscription for update the product Imo sqlrdd is more good product because non require a server compoment ( require your app linked with slrdd and your database server(mssql) mediator require mediator server either will run with an -ASP .NET WEB but must uderstand the layer of emulation of sqlrdd/mediator for example you need a recno() in clipper application and it must be made on server side but you must understand how if you wand add valid record i suggest you convert one application with this product http://www.xharbour.com/index.asp?pa...addon_sqlrdd_1 http://www.otc.pl/download/default.aspx?l=2 basically with sqlrdd i have add in top of my source #ifdef __SQLRDD__ #include "sqlrdd.ch" #include "dbinfo.ch" RddSetDefault("SQLRDD" ) G_RDDACT := "SQLRDD" G_RDDACT2:="DBFCDX" cConnString=MEMOREAD("SQL.DB") nCnn := SR_AddConnection( 1, cConnString ) If nCnn < 0 ? "Connection error. See SQL1.LOG for details." QUIT ENDIF ? "Connected to :", SR_GetConnectionInfo(,17 ), SR_GetConnectionInfo(, 18 ) #ENDIF sql.db is where is myexe and containt for sql2005 express Driver={SQL Server};Network Library=dbmssocn;server=MYSRV \SQLEXPRESS;database=test;uid=sa;pwd=Mypwd; |
|
|||
|
Hi Massimo,
Thanks. My problem is not so much connecting to a MS SQL server from xharbour, cause that works fine with a local server. I just have trouble setting up an ODBC connection with a remote server. I really have no clue what I'm doing wrong, and I wondered if there was anybody that could provide me with an example. Thanks again. Gerard "Massimo Belgrano" <massimo.belgrano@gmail.com> schreef in bericht news:c15564ad-63cf-4d60-a3fa-2d9c0db0be9a@y24g2000hsd.googlegroups.com... > On 1 Apr, 14:57, "Gerard" <codg...@yahoo.com> wrote: >> Hi, >> >> Recently I've started converting our xharbour applications so that they >> will >> use a MS SQL database rather than dbf's. On my laptop everything works >> fine >> so far, I use the Microsoft SQL server management studio express (2005). >> Setting up an ODBC connection was relatively easy. >> >> However, if I try to connect to our main MS SQL server (SBS 2003) via TCP >> IP, I seem to be unable to even set up an ODBC connection. Does anybody >> have >> an example of setting for both client and server side that have to be >> used >> to accomplish this task? Thanks in advance. >> >> Gerard > Are you using sqlrdd? > either Mediator and sqlrdd have a good product for convert an existing > application > sqlrdd is royaltyfree but require a subscription for update the > product > Imo sqlrdd is more good product because non require a server compoment > ( > require your app linked with slrdd and your database server(mssql) > mediator require mediator server > > > either will run with an -ASP .NET WEB but must uderstand the layer of > emulation of sqlrdd/mediator > for example you need a recno() in clipper application and it must be > made on server side but you must understand how if you wand add valid > record > i suggest you convert one application with this product > http://www.xharbour.com/index.asp?pa...addon_sqlrdd_1 > http://www.otc.pl/download/default.aspx?l=2 > basically with sqlrdd i have add in top of my source > #ifdef __SQLRDD__ > #include "sqlrdd.ch" > #include "dbinfo.ch" > RddSetDefault("SQLRDD" ) > G_RDDACT := "SQLRDD" > G_RDDACT2:="DBFCDX" > cConnString=MEMOREAD("SQL.DB") > nCnn := SR_AddConnection( 1, cConnString ) > If nCnn < 0 > ? "Connection error. See SQL1.LOG for details." > QUIT > ENDIF > ? "Connected to :", SR_GetConnectionInfo(,17 ), > SR_GetConnectionInfo(, 18 ) > #ENDIF > > sql.db is where is myexe and containt for sql2005 express > Driver={SQL Server};Network Library=dbmssocn;server=MYSRV > \SQLEXPRESS;database=test;uid=sa;pwd=Mypwd; |
|
|||
|
On 1 Apr, 16:55, "Gerard" <codg...@yahoo.com> wrote:
> Hi Massimo, > > Thanks. My problem is not so much connecting to a MS SQL server from > xharbour, cause that works fine with a local server. > > I just have trouble setting up an ODBC connection with a remote server. I > really have no clue what I'm doing wrong, and I wondered if there was > anybody that could provide me with an example. Thanks again. > > Gerard > "Massimo Belgrano" <massimo.belgr...@gmail.com> schreef in berichtnews:c15564ad-63cf-4d60-a3fa-2d9c0db0be9a@y24g2000hsd.googlegroups.com... > > > > > On 1 Apr, 14:57, "Gerard" <codg...@yahoo.com> wrote: > >> Hi, > > >> Recently I've started converting our xharbour applications so that they > >> will > >> use a MS SQL database rather than dbf's. On my laptop everything works > >> fine > >> so far, I use the Microsoft SQL server management studio express (2005).. > >> Setting up an ODBC connection was relatively easy. > > >> However, if I try to connect to our main MS SQL server (SBS 2003) via TCP > >> IP, I seem to be unable to even set up an ODBC connection. Does anybody > >> have > >> an example of setting for both client and server side that have to be > >> used > >> to accomplish this task? Thanks in advance. > > >> Gerard > > Are you using sqlrdd? > > either Mediator and sqlrdd have a good product for convert an existing > > application > > sqlrdd is royaltyfree but require a subscription for update the > > product > > Imo sqlrdd is more good product because non require a server compoment > > ( > > require your app linked with slrdd and your database server(mssql) > > mediator require mediator server > > > either will run with an -ASP .NET WEB but must uderstand the layer of > > emulation of sqlrdd/mediator > > for example you need a recno() in clipper application and it must be > > made on server side but you must understand how if you wand add valid > > record > > i suggest you convert one application with this product > >http://www.xharbour.com/index.asp?pa...addon_sqlrdd_1 > >http://www.otc.pl/download/default.aspx?l=2 > > basically with sqlrdd i have add in top of my source > > * *#ifdef __SQLRDD__ > > * * *#include "sqlrdd.ch" > > * * *#include "dbinfo.ch" > > * * *RddSetDefault("SQLRDD" ) > > * * *G_RDDACT := "SQLRDD" > > * * *G_RDDACT2:="DBFCDX" > > * * *cConnString=MEMOREAD("SQL.DB") > > * * *nCnn := SR_AddConnection( 1, cConnString ) > > * * *If nCnn < 0 > > * * * * *? "Connection error. See SQL1.LOG for details." > > * * * * *QUIT > > * * * ENDIF > > * * * *? "Connected to * * * *:", SR_GetConnectionInfo(,17 ), > > SR_GetConnectionInfo(, 18 ) > > * *#ENDIF > > > sql.db is where is myexe and containt for sql2005 express > > Driver={SQL Server};Network Library=dbmssocn;server=MYSRV > > \SQLEXPRESS;database=test;uid=sa;pwd=Mypwd;- Nascondi testo tra virgolette - > > - Mostra testo tra virgolette - Please post an example of your code so i better understand Can help a connection string? Driver={SQL Server};Network Library=dbmssocn;server=192.168.0.1\SQLEXPRESS;dat abase=test;uid=sa;pwd=Mypwd;- Nascondi testo tra virgolette - http://www.connectionstrings.com/?carrier=sqlserver2005 |
|
|||
|
> I just have trouble setting up an ODBC connection with a remote server. I
> really have no clue what I'm doing wrong, and I wondered if there was > anybody that could provide me with an example. Thanks again. http://www.depts.ttu.edu/helpcentral.../ODBCSetup.php |
|
|||
|
My My ... ODBC, no way ... you can use ADO without any ODBC or client
configuration. xHarbour has OLE cability built in .. use the associated syntax to connect to your MS Sql database. Rick Lipkin xPROVIDER := "SQLOLEDB" xSOURCE := "MSSQL01" xCATALOG := "PCAS" xUSERID := "pcasuser" xPASSWORD := "pcas" oRs := TOleAuto():New( "ADODB.Recordset" ) oRs:CursorType := 1 // opendkeyset oRs:CursorLocation := 3 // local cache oRs:LockType := 3 // lockoportunistic cSQL := "SELECT * FROM utility WHERE progid ='"+xPROGID+"'" TRY oRS:Open(cSQL,'Provider='+xPROVIDER+';Data Source='+xSOURCE+';Initial Catalog='+xCATALOG+';User Id='+xUSERID+';Password='+xPASSWORD ) CATCH oErr RETURN( NIL) END TRY IF oRs:eof SAYING := "SORRY .. Could not find PROGID "+xPROGID+" associated with this location" MsgInfo( SAYING ) oRs:Close() RETURN(NIL) ENDIF "Gerard" <codgy63@yahoo.com> wrote in message news:fsthqr$1o1$1@aioe.org... > Hi Massimo, > > Thanks. My problem is not so much connecting to a MS SQL server from > xharbour, cause that works fine with a local server. > > I just have trouble setting up an ODBC connection with a remote server. I > really have no clue what I'm doing wrong, and I wondered if there was > anybody that could provide me with an example. Thanks again. > > Gerard > "Massimo Belgrano" <massimo.belgrano@gmail.com> schreef in bericht > news:c15564ad-63cf-4d60-a3fa-2d9c0db0be9a@y24g2000hsd.googlegroups.com... >> On 1 Apr, 14:57, "Gerard" <codg...@yahoo.com> wrote: >>> Hi, >>> >>> Recently I've started converting our xharbour applications so that they >>> will >>> use a MS SQL database rather than dbf's. On my laptop everything works >>> fine >>> so far, I use the Microsoft SQL server management studio express (2005). >>> Setting up an ODBC connection was relatively easy. >>> >>> However, if I try to connect to our main MS SQL server (SBS 2003) via >>> TCP >>> IP, I seem to be unable to even set up an ODBC connection. Does anybody >>> have >>> an example of setting for both client and server side that have to be >>> used >>> to accomplish this task? Thanks in advance. >>> >>> Gerard >> Are you using sqlrdd? >> either Mediator and sqlrdd have a good product for convert an existing >> application >> sqlrdd is royaltyfree but require a subscription for update the >> product >> Imo sqlrdd is more good product because non require a server compoment >> ( >> require your app linked with slrdd and your database server(mssql) >> mediator require mediator server >> >> >> either will run with an -ASP .NET WEB but must uderstand the layer of >> emulation of sqlrdd/mediator >> for example you need a recno() in clipper application and it must be >> made on server side but you must understand how if you wand add valid >> record >> i suggest you convert one application with this product >> http://www.xharbour.com/index.asp?pa...addon_sqlrdd_1 >> http://www.otc.pl/download/default.aspx?l=2 >> basically with sqlrdd i have add in top of my source >> #ifdef __SQLRDD__ >> #include "sqlrdd.ch" >> #include "dbinfo.ch" >> RddSetDefault("SQLRDD" ) >> G_RDDACT := "SQLRDD" >> G_RDDACT2:="DBFCDX" >> cConnString=MEMOREAD("SQL.DB") >> nCnn := SR_AddConnection( 1, cConnString ) >> If nCnn < 0 >> ? "Connection error. See SQL1.LOG for details." >> QUIT >> ENDIF >> ? "Connected to :", SR_GetConnectionInfo(,17 ), >> SR_GetConnectionInfo(, 18 ) >> #ENDIF >> >> sql.db is where is myexe and containt for sql2005 express >> Driver={SQL Server};Network Library=dbmssocn;server=MYSRV >> \SQLEXPRESS;database=test;uid=sa;pwd=Mypwd; > > |
|
|||
|
Thanks Rick,
I tried to use ODBC because that was used in the manuals we got when we bought xBuilder. I'll try ADO. Maybe a stupid question, but in the example you provided, where do you define which SQL database to use? And in case it's a remote database, do you have to do anything extra to access it? (settings, etc.) Gerard "Rick Lipkin" <lipkinrm29063@yahoo.com> schreef in bericht news:47f2c869$0$1341$834e42db@reader.greatnowhere. com... > My My ... ODBC, no way ... you can use ADO without any ODBC or client > configuration. xHarbour has OLE cability built in .. use the associated > syntax to connect to your MS Sql database. > > Rick Lipkin > > > xPROVIDER := "SQLOLEDB" > xSOURCE := "MSSQL01" > xCATALOG := "PCAS" > xUSERID := "pcasuser" > xPASSWORD := "pcas" > > > oRs := TOleAuto():New( "ADODB.Recordset" ) > oRs:CursorType := 1 // opendkeyset > oRs:CursorLocation := 3 // local cache > oRs:LockType := 3 // lockoportunistic > > cSQL := "SELECT * FROM utility WHERE progid ='"+xPROGID+"'" > TRY > oRS:Open(cSQL,'Provider='+xPROVIDER+';Data Source='+xSOURCE+';Initial > Catalog='+xCATALOG+';User Id='+xUSERID+';Password='+xPASSWORD ) > CATCH oErr > RETURN( NIL) > END TRY > > IF oRs:eof > SAYING := "SORRY .. Could not find PROGID "+xPROGID+" associated with > this location" > MsgInfo( SAYING ) > oRs:Close() > RETURN(NIL) > ENDIF > > > > "Gerard" <codgy63@yahoo.com> wrote in message > news:fsthqr$1o1$1@aioe.org... >> Hi Massimo, >> >> Thanks. My problem is not so much connecting to a MS SQL server from >> xharbour, cause that works fine with a local server. >> >> I just have trouble setting up an ODBC connection with a remote server. I >> really have no clue what I'm doing wrong, and I wondered if there was >> anybody that could provide me with an example. Thanks again. >> >> Gerard >> "Massimo Belgrano" <massimo.belgrano@gmail.com> schreef in bericht >> news:c15564ad-63cf-4d60-a3fa-2d9c0db0be9a@y24g2000hsd.googlegroups.com... >>> On 1 Apr, 14:57, "Gerard" <codg...@yahoo.com> wrote: >>>> Hi, >>>> >>>> Recently I've started converting our xharbour applications so that they >>>> will >>>> use a MS SQL database rather than dbf's. On my laptop everything works >>>> fine >>>> so far, I use the Microsoft SQL server management studio express >>>> (2005). >>>> Setting up an ODBC connection was relatively easy. >>>> >>>> However, if I try to connect to our main MS SQL server (SBS 2003) via >>>> TCP >>>> IP, I seem to be unable to even set up an ODBC connection. Does anybody >>>> have >>>> an example of setting for both client and server side that have to be >>>> used >>>> to accomplish this task? Thanks in advance. >>>> >>>> Gerard >>> Are you using sqlrdd? >>> either Mediator and sqlrdd have a good product for convert an existing >>> application >>> sqlrdd is royaltyfree but require a subscription for update the >>> product >>> Imo sqlrdd is more good product because non require a server compoment >>> ( >>> require your app linked with slrdd and your database server(mssql) >>> mediator require mediator server >>> >>> >>> either will run with an -ASP .NET WEB but must uderstand the layer of >>> emulation of sqlrdd/mediator >>> for example you need a recno() in clipper application and it must be >>> made on server side but you must understand how if you wand add valid >>> record >>> i suggest you convert one application with this product >>> http://www.xharbour.com/index.asp?pa...addon_sqlrdd_1 >>> http://www.otc.pl/download/default.aspx?l=2 >>> basically with sqlrdd i have add in top of my source >>> #ifdef __SQLRDD__ >>> #include "sqlrdd.ch" >>> #include "dbinfo.ch" >>> RddSetDefault("SQLRDD" ) >>> G_RDDACT := "SQLRDD" >>> G_RDDACT2:="DBFCDX" >>> cConnString=MEMOREAD("SQL.DB") >>> nCnn := SR_AddConnection( 1, cConnString ) >>> If nCnn < 0 >>> ? "Connection error. See SQL1.LOG for details." >>> QUIT >>> ENDIF >>> ? "Connected to :", SR_GetConnectionInfo(,17 ), >>> SR_GetConnectionInfo(, 18 ) >>> #ENDIF >>> >>> sql.db is where is myexe and containt for sql2005 express >>> Driver={SQL Server};Network Library=dbmssocn;server=MYSRV >>> \SQLEXPRESS;database=test;uid=sa;pwd=Mypwd; >> >> > > |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: SAS OLAP Cubes creation on SQL Server Database | Alan Churchill | Newsgroup comp.soft-sys.sas | 0 | 05-16-2006 12:16 PM |
| Re: loading sas dates into sql server | Michael Raithel | Newsgroup comp.soft-sys.sas | 0 | 12-29-2005 01:50 PM |
| Re: SAS 9.1.3 on AIX and ACCESS to SQL Server | Nigel Pain | Newsgroup comp.soft-sys.sas | 0 | 05-13-2005 04:33 PM |
| updating SQL server data using Proc SQL via ODBC | ekwan@sfcc-cpmc.net | Newsgroup comp.soft-sys.sas | 0 | 02-28-2005 10:56 PM |
| Re: Update data to Ms sql server by sas code | Sigurd Hermansen | Newsgroup comp.soft-sys.sas | 0 | 12-14-2004 02:16 PM |