topic
stringlengths
1
63
text
stringlengths
1
577k
ADO Absoluteposition
You can't use AbsolutePosition property across different recordset. The right solution is using an Id field (that you should have anyway). EMG
ADO AddNew
Hola a todos. Hace unas semanas he empezado a trabajar con ADO, tengo una duda (bueno tengo mas de una). Estoy visualizando un recordset con un txbrowse, dicho recordset por su naturaleza no me permite ejecutar AddNew. Cual seria la manera mas eficiente y comoda para realizar un alta. 1.- Ejecutar un insert con el metodo Execute del objeto connection. 2.- Lo mismo que antes pero con el objeto command 3.-Crear otro recordset con solo los campos de la tabla en cuestion y me permita hacer AddNew. Esta segunda parece mas comoda, pero que source le pongo, si realmente no me interesa me recupere ningun registro¿?. O puedo poner el cursor en el lado del cliente y asi no descarga registros ?¿ o ...?¿ 4.- ... Please opiniones de los expertos, gracias anticipadas.
ADO AddNew
HOla Mira: Inserir registro: [code:2600aazp] oRs:AddNew() oRs:Fields( "id" ):Value := "00001" oRs:Fields( "nombre" ):Value := "JOSE CARLOS DA ROCHA" oRs:Fields( "apelido" ):Value := "ROCHINHA" oRs:Fields( "pais" ):Value := "BRASIL" oRs:Update() // Actualiza o recordset [/code:2600aazp] Alterar registro: [code:2600aazp] oRs:Fields( "id" ):Value := "00001" oRs:Fields( "nombre" ):Value := "JOSE CARLOS DA ROCHA" oRs:Fields( "apelido" ):Value := "ROCHINHA" oRs:Fields( "pais" ):Value := "BRASIL" oRs:Update() // Actualiza o recordset [/code:2600aazp] Borrar registro: [code:2600aazp] oRs:Delete() oRs:ReQuery() // opcional [/code:2600aazp] Ok?
ADO AddNew
Gracias Rochinha, pero eso no es exactamente lo que estaba preguntando. Yo ya conozco los metodos para altas bajas y modificaciones. El problema es que el browse esta basado sobre un recordset (oRS) no editable. Y la pregunta, es cual seria el metodo mas rapido para dar el alta. Otro recordset que permita addnew, inser con execute, ...
ADO AddNew
Amigo Lo recordset esta basado en que tipo de BD? Yo trabajo en modo local, cliente. Revisa se la abertura es ReadOnly [code:1elnc654] LOCAL oConn := TOLEAUTO():New("adodb.connection") PRIVATE oRecordset := TOLEAUTO():New("adodb.recordset") oConn:Open("Provider= MicroSoft.Jet.OLEDB.4.0;Data Source=.\arquivo.mdb;") oRecordSet:LockType := adLockOptimistic // adLockReadOnly oRecordSet:CursorType := adOpenKeyset oRecordSet:ActiveConnection(oConn) oRecordSet:Source := "Select * from clientes" // tu query aqui oRecordSet:Open() oRecordSet:MoveFirst() aDatos := {} DO WHILE ! oRecordSet:eof() aReng := {} FOR x := 1 TO oRecordSet:Fields:Count() AADD(aReng,oRecordSet:Field(x-1):Value NEXT AADD(aDatos,aReng) oRecordSet:MoveNext ENDDO oRecordSet:Close() oConn:Close() [/code:1elnc654] Saludos
ADO AddNew
El recordset ataca una bases de datos DB2, y el source es [code:3rhsfa3d] cSql&#58;= "SELECT EmpCod,Anyo,NumPed,Fecha,Hora,Usr,NetName,Servir,CliCod,Obs1,Obs2,"+; "Servido,Presu,Kilos,Ava3Tx,Ava4Tx,Ava6Tx,Ava7Tx,Ava8Tx,Ava9Tx,Avbatx,AvbCtx,AvbDtx"+; " FROM &#40;SELECT PedCab&#46;EmpCod AS TotEmp, PedCab&#46;Anyo as TotAny, PedCab&#46;NumPed as TotNum,"+; " SUM&#40;UDS*PESO&#41; AS KILOS FROM PEDCAB LEFT JOIN PEDDET ON PEDCAB&#46;EMPCOD= PEDDET&#46;EMPCOD AND"+; " PEDCAB&#46;ANYO=PEDDET&#46;ANYO AND PEDCAB&#46;NUMPED=PEDDET&#46;NUMPED GROUP BY"+; " PEDCAB&#46;EMPCOD, PEDCAB&#46;ANYO, PEDCAB&#46;NUMPED&#41; AS TOTAL, " +; " PedCab LEFT JOIN PiCliep ON EmpCod=Avaccd AND CliCod=Ava4cd"+; " WHERE PedCab&#46;EmpCod=Total&#46;TotEmp AND PedCab&#46;Anyo=Total&#46;TotAny AND PedCab&#46;NumPed=Total&#46;TotNum" [/code:3rhsfa3d] Este recordset no me perimite hacer AddNew(supongo que por el join , o por alguna otra cosa, no por el tipo de cursor, ni tipo de blouqeo), entonces debo utilizar otro recordset sobre la tabla base PedCab, o capturar los datos en variables y volcarlos con excute "insert ... ", y la pregunta cual es el metodo mejor. PD. Los nombre de atributos son rarillos porque la tabla clientes fue creada con una herammienta Case que maneja diccionario de datos, y les pone estos nombres tan chulos y a la vez descriptivos <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> (Ava3Tx,Ava4Tx,Ava6Tx...)
ADO AddNew
Si Entonces debes usar INSERT pois con ele tu iras referenciar la tabla alvo mas directamente.
ADO Como se Pregunta si una Columna es Nula (Solicionado)
COmo se pregunta si un coloumna es Nula Null Tengo entendido que en xharbour equivale a Nill vara := iif(oDatos:Fields("nombre_estilo"):Value = Nill," ",oDatos:Fields("nombre_estilo"):Value) Esto eata bien Tengo FWH 8.03 y xharbour 21/August/2008 1.1.0 Rev 6195
ADO Como se Pregunta si una Columna es Nula (Solicionado)
Hola Ruben... Tienes 3 formas de preguntar si la columna es Nula. 1. Antes de cargar el recordset usando una consulta sql: (Con Mysql) select ifnull(colfecha,now()) as NuevaCol FROM Tabla where otracol IS NULL Si la colfecha no es nula me devuleve colfecha, de lo contrario me da la fecha actual, y haga esto con todos los registros cuya otracol es nula. 2 Por ejemplo si quieres hacer un filtro desde el propio recordset con las columnas cuya fecha sea nula haríamos: oRs:Filter:="colfecha=NULL" 3. Desde Harbour ya es conocido para todos que se puede preguntar si un valor devuelto es nulo así: if(ors:Fields('colfecha'):Value)=nil Culquiera de estas puedes usarlo dependiendo del escenario donde te encuentres. Espero te sirva de algo. Un saludo Marcelo Jingo
ADO Como se Pregunta si una Columna es Nula (Solicionado)
[quote="sjingo":3vhri68v]Hola Ruben... Tienes 3 formas de preguntar si la columna es Nula. 1. Antes de cargar el recordset usando una consulta sql: (Con Mysql) select ifnull(colfecha,now()) as NuevaCol FROM Tabla where otracol IS NULL Si la colfecha no es nula me devuleve colfecha, de lo contrario me da la fecha actual, y haga esto con todos los registros cuya otracol es nula. 2 Por ejemplo si quieres hacer un filtro desde el propio recordset con las columnas cuya fecha sea nula haríamos: oRs:Filter:="colfecha=NULL" 3. Desde Harbour ya es conocido para todos que se puede preguntar si un valor devuelto es nulo así: if(ors:Fields('colfecha'):Value)=nil Gracias , Esto es lo que necesitaba. Culquiera de estas puedes usarlo dependiendo del escenario donde te encuentres. Espero te sirva de algo. Un saludo Marcelo Jingo[/quote:3vhri68v]
ADO Como se Pregunta si una Columna es Nula (Solicionado)
[quote="sjingo":3h7f92iu]Hola Ruben... Tienes 3 formas de preguntar si la columna es Nula. 1. Antes de cargar el recordset usando una consulta sql: (Con Mysql) select ifnull(colfecha,now()) as NuevaCol FROM Tabla where otracol IS NULL Si la colfecha no es nula me devuleve colfecha, de lo contrario me da la fecha actual, y haga esto con todos los registros cuya otracol es nula. 2 Por ejemplo si quieres hacer un filtro desde el propio recordset con las columnas cuya fecha sea nula haríamos: oRs:Filter:="colfecha=NULL" 3. Desde Harbour ya es conocido para todos que se puede preguntar si un valor devuelto es nulo así: if(ors:Fields('colfecha'):Value)=nil Culquiera de estas puedes usarlo dependiendo del escenario donde te encuentres. Espero te sirva de algo. Un saludo Marcelo Jingo[/quote:3h7f92iu] Oye te pregun como coloco una imagen .JPG no en podido colocarla se selecciona el icono y aparece lo que esta a continuacion, pero como cargo la imagen
ADO Como se Pregunta si una Columna es Nula (Solicionado)
No entiendo a que te refieres. Si lo que quieres es subir una imagen a tu mensaje mira el siguiente enlace: [url:1fyf2kc5]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=6&t=17413&p=90548&hilit=subir+imagen#p90548[/url:1fyf2kc5] Un Saludo Marcelo Jingo
ADO Connection to Oracle 10g
To All I am trying to connect to an Oracle 10g database using the following code which fails every time .. any assistance would be appreciated. Looking on MSDN there is some confusion as to "SOURCE" being the server name .. in this example the EFIS is that actual name of the database that resides on the server name EQCAIX3 .. Rick Lipkin xPROVIDER := "MSDAORA" xSOURCE := "EFIS" xUSERID := "SUNTRACK" xPASSWORD := "goefis10" oRs := TOleAuto():New( "ADODB.Recordset" ) oRs:CursorType := 1 // opendkeyset oRs:CursorLocation := 3 // local cache oRs:LockType := 3 // lockoportunistic cSQL := "SELECT * FROM EFIS_UST_RELEASES" TRY oRS:Open(cSQL,'Provider='+xPROVIDER+';Data Source='+xSOURCE+';User Id='+xUSERID+';Password='+xPASSWORD ) * oRs:Open(cSQL, "Provider=madaora;Data Source=efis;Persist Security Info=False;User ID=suntrack;Password=goefis10" ) CATCH oErr MsgInfo( "Error in Opening EFIS_UST_RELEASES table" ) CLOSE DATABASES QUIT END TRY
ADO Connection to Oracle 10g
I don't know it this can be of any help but try: [code:3pqhjgaj]cSQL &#58;= "SELECT * FROM &#91;EFIS_UST_RELEASES&#93;"[/code:3pqhjgaj] EMG
ADO Connection to Oracle 10g
Enrico Sorry .. that did not work .. I think it has something to do with the 'source' parameter .. i am missing something from my side on the identification .. server name perhaps, sciema prefix .. something like that. Rick
ADO Connection to Oracle 10g
For Source we should use the TNS Name of the Server/Database. It is the name used in TNS Confuration of the Oracle Client on the PC client. It is not the physical servername or the database name given by the DBA on the server. If you open connection object separately, ( i advise not mix with opening recordset) and examine the connection object's error object, you narrow down the problem and know where exactly the error is. I suggest something like this [code:5ie2md8c] cConnStr &#58;= 'Provider=MSDAORA&#46;1;Data Source=<TNSnameofServer>;User ID= &#46;&#46;&#46;&#46; ;Password- &#46;&#46;' oCon &#58;= TOLEAuto&#40;&#41;&#58;New&#40;'ADODB&#46;Connection'&#41; oCon&#58;ConnectionString &#58;= cConnStr TRY oCon&#58;Open&#40;&#41; CATCH ShowAdoError&#40;oCon&#41; Return &#46;f&#46; END // now open any number of recordsets using the above conn object oRs &#58;= TOLEAuto&#40;&#41;&#58;New&#40;'ADODB&#46;RecordSet'&#41; TRY oRs&#58;Open&#40; <sql>, oCon, <other params > &#41; CATCH ShowAdoError&#40;oCon&#41; END //------------- STATIC FUNCTION ShowAdoError LOCAL nAdoErrors &#58;= 0 LOCAL oAdoErr nAdoErrors &#58;= oCon&#58;Errors&#58;Count&#40;&#41; IF nAdoErrors > 0 oAdoErr &#58;= oCon&#58;Errors&#40;nAdoErrors-1&#41; msginfo&#40; oAdoErr&#58;Description + CRLF + oAdoErr&#58;Source &#41; ELSE msginfo&#40; 'Not Oracle Error' &#41; ENDIF RETURN nil [/code:5ie2md8c] Once we successfully open the connection object, we can use the same connection object to open hundreds of recordsets or use execute commands. Opening RecSet with connection string each time will open new connection each time with two disadvantages (1) Server will have too many connections open and 32 bit windows server will reach its limit soon, denying service to next users(2) isolating the error becomes difficult.
ADO Connection to Oracle 10g
Schema prefix is to be used with table names as <schema>.<table>. It is always a safe and good programming practice to use schema prefix for all tables in oracle
ADO Connection to Oracle 10g
nageswaragunupudi WOW ... thanks for the great answer .. I will try your code in the morning. I was using the DNS name of the server for the source .. I do have a tnsnames.ora file .. I think the tns name is 'efis.world' .. The schema is 'suntrack' .. so my guess will be to use : xPROVIDER := "MSDAORA" xSOURCE := "EFIS.world" xUSERID := "me" xPASSWORD := "mypassword" oRs := TOleAuto():New( "ADODB.Recordset" ) oRs:CursorType := 1 // opendkeyset oRs:CursorLocation := 3 // local cache oRs:LockType := 3 // lockoportunistic cSQL := "SELECT * FROM Suntrack.EFIS_UST_RELEASES" TRY oRS:Open(cSQL,'Provider='+xPROVIDER+';Data Source='+xSOURCE+';User Id='+xUSERID+';Password='+xPASSWORD ) * oRs:Open(cSQL, "Provider=madaora;Data Source=efis;Persist Security Info=False;User ID=suntrack;Password=goefis10" ) CATCH oErr MsgInfo( "Error in Opening EFIS_UST_RELEASES table" ) CLOSE DATABASES QUIT END TRY
ADO Connection to Oracle 10g
Data Source = 'efis.world'. For some reasons i did not like the .world extention. Had some issues with it. All our client installations have tns names without the .world. Please try efis.world first as the data source name. you should be able to connect. I once again recommend opening the connection object only in the beginning of the program. Check the validity of connection, check if it is open ( oCon:State == 1 ) and then proceed with rest of the work. At the end of program, close the connection with oCon:Close. For opening recordsets, use oCon object in the place of the connection string each time. This apporach has a lot more advantages than I could explain in the earlier post. We do see many asp page sources with total connection string while opening recordsets. That is a 3-tier architecture and a different environment of stateless connections and disconnected recordsets. For client-server programming ( 2-tier ) what I proposed is the best. You may consider if you like.
ADO Connection to Oracle 10g
nageswaragunupudi Was curious to try your code .. your error message was much more informative than just 'e_fail' .. I got this message that 'Oracle client and networking componants not found. These componants are supplied by Oracle Corp and are part of the Oracle Version 7.3.3 or later client software installation. Provider is unable to function until these componants are installed. Microsoft OLE DB Provider for Oracle' I was hoping MSDAORA would have everything I need .. I do have the thick client of Oracle 6i on my machine .. but I don't believe this is what I need .. further research on the client is the first order of business in the morning .. Many Thanks Rick Lipkin ps .. I took your code on the connection and used it .. your 'catch' error was much better .. I did try both 'efis' and 'efis.world' .. got the same result.
ADO Connection to Oracle 10g
You have to install oracle 10g client that comes along with oracle server software. After installing, you should configure TNS names. Only then our software runs on your PC. ( note: we need the client software on the user pc for every RDMS. For ADS we put the DLLs in the appn directory. Windows comes with MSSQL client software preloaded. ) Now you need to install Oracle 10g client on every PC in your office that uses your software and configure on every PC the tns names to match what you use in your software. For reasons of safety you shd ensure removal of tools like SQL plus from all those PCs (except yours)
ADO Connection to Oracle 10g
nageswaragunupudi I gathered as much about the client .. was hoping to avoid any complicated setups .. We currently have a 'very ugly' fat client Oracle forms 6i client .. over 1200 some .fmx forms that get depolyed to over 100 servers <!-- s:( --><img src="{SMILIES_PATH}/icon_sad.gif" alt=":(" title="Sad" /><!-- s:( --> . I saw on the Oracle website the Quick 10 or 11i client download .. would this work ( do you think ) or do I need to just go back to the Oracle 10g disk and install the client files ?? Rick Lipkin
ADO Connection to Oracle 10g
[quote:1xjawhjc] I saw on the Oracle website the Quick 10 or 11i client download .. would this work ( do you think ) or do I need to just go back to the Oracle 10g disk and install the client files ?? [/quote:1xjawhjc] I did not try the thin clients. But I had enough information from oracle colleagues not to try. Till you read more ( I shall also now look into this seriously) and do some experiements I do not advise you to go for the so called thin clients now. Please do install oracle 10g client by all means from the package provided by the oracle inc. It does not really take too much space, but it works well and you can develop your applications. One big advantage is during developent of complex applications you need not consider any problems from the client. [quote:1xjawhjc] was hoping to avoid any complicated setups [/quote:1xjawhjc] It is not really complicated, though not as simple as others. Well we have to do some extra work to get the real power of Oracle which still has no parallel. ( not talking about DB2) [quote:1xjawhjc] We currently have a 'very ugly' fat client Oracle forms 6i client .. over 1200 some .fmx forms that get depolyed to over 100 servers [/quote:1xjawhjc] It is high time we get rid of the old style forms development and deployment ( unless you use the new tools to make it webbased). But sure if you develop applications in fwh+xharbour we dont need the forms. You dont have to install oracle developer and forms. Just install the client.
ADO Connection to Oracle 10g
nageswaragunupudi We are actually running Oracle version 9.2.0.6 .. not 10g as I origionally thought. I have the Ora9i cd and have installed the client portion of the 3 disk cd .. still getting the version 7.3.3 error Any thoughts or pointers ?? RIck
ADO Connection to Oracle 10g
Please check the PATH and make sure it points to the location of the new isntallation. For example the path on this pc is "PATH=C:\oracle\product\10.2.0\client_1\bin;"
ADO Connection to Oracle 10g
nageswaragunupudi The very first statement in the path is where I installed ( what I hoped was the client ) Ora9i .. c:\ora9i\bin .. Perhaps I installed the wrong thing .. would you be so kind as to find me a link to download the proper client .. I noticed in your code .. you have c:\oracle\client .... I do not have any of those paths .. I would be grateful !! Thanks Rick Lipkin
ADO Connection to Oracle 10g
Can you please send me the directory structure of your ora9i directory? you can save it as text file by going to c:\ora9i ( DOS PROMPT ) and issue command "DIR /S > ORADIR.TXT". Please send to my personal email <!-- e --><a href="mailto:nageswaragunupudi@gmail.com">nageswaragunupudi@gmail.com</a><!-- e -->
ADO Date time update SQL Server
To AllHow can I convert date() to a datetime field in MS Sql server .. I was given this formula and it does work but does not insert the correctdate into the date portion of the field ..nDateTime := ( DATE() - CTOD("") )+( SECONDS()/ (24*3600)) equals something like 6/19/8620 5:17:14 PMAs you can see .. todays date is 05/22/2008 5:17 PM ..I have records sorted by date desc and SQL server does not take into account natural order .. when you insert DATE() into a datetime field you get 5/22/2008 12:00 PM .. and if you have two rows with the same date .. I can not descriminate the time since both have the same 'default' time.. I need to be able to insert the date and time into the datetime fields to make the rows sort correctly.Any advice or help would be appreciated BIG-TIME !!Rick LipkinSC Dept of Health, USA
ADO Date time update SQL Server
Rick,esto es un error grave de xharbour , ADO solamente devuelve la FECHAdejando fuera la hora,este tema ya se habia mensionado en mensajes anteriores,pero nadie ha dado una solucion,saludos..
ADO Date time update SQL Server
[quote:2uw9lds4]Rick, this is a serious error of xharbour, ADO only returns the DATE leaving was the hour, this theme already itself habia mensionado in previous messages, but nobody has given a solucion, Greetings.. [/quote:2uw9lds4]I seem to have run into that 'brick wall' .. will do some more searching ..ThanksRick Lipkin
ADO Date time update SQL Server
Rick,[code:gkovxcua] set date american set century on &#46;&#46;&#46; oRs&#58;Source &#58;= "Update <your table> set <your datetime field> = '"+; dtoc&#40;date&#40;&#41;&#41;+" "+time&#40;&#41;+"' where &#46;&#46;&#46;&#46;&#46;&#46;" &#46;&#46;&#46; oRs&#58;Open&#40;&#41; [/code:gkovxcua]This update work for me and i get a proper datetime value in table.Maby I don't understand your problem. If so - sorry.Regards Eugeniusz
ADO Date time update SQL Server
Eugeniusz Owsiak* dtoc(date())+" "+time() * .. WOW, that worked !!!!!!!!!!!!! beating my head against the wall here over something so simple.Glad you had a better pair of eyes than I did ..Thanks for the HELP !!Rick Lipkin
ADO Date time update SQL Server
If you are using xHarbour, you can straighaway use datetime.dtDate := DateTime()oRs:Field(x):Value := dtDateNow xHarbour can handle date and time together, it is no more necesssary for us to handle date and time separately
ADO Datetime field
To All How do I concantonate date()+time() into a datetime field to SQL server with ADO ?? The reason to add the time stamp is because SQl server does not respect 'natural order'. When I have multiple entry's on the same date() .. SQL will order them randomly within the same date and not as they were added to the table by date .. however if I add the Time() aspect to the datetime field .. the records sort in order of actual sequence. Rick Lipkin SC Dept of Health, USA
ADO Datetime field
Convert date and seconds into a double value like this and assign the value. Date field in OLE can be assigned a value as date or double [code:8hhsglu6] nDateTime &#58;= &#40; dDate - CTOD&#40;""&#41;&#41; + &#40;nSeconds/&#40;24*3600&#41;&#41; oRs&#58;Fields&#40;"datetimefield"&#41;&#58;Value &#58;= nDateTime [/code:8hhsglu6] This works for all OLE applns, with win32ole.prg of xHarbour. Thiis is working me for Excel and Oracle. Should work for MSSql also. Regards
ADO Exclusive open
Is it possible to open a recordset in exclusive mode so others cannot open it ?
ADO Exclusive open
Hi AHF, I don't think it is possible, because the exclusive locking is against usual database principles, and ADO is just an abstraction layer, so that kind of behavoir is depending on the data engine itself, not ADO. May be if you are using some particular data drivers you can state in the string connection that you won't share any data, but it's up to the driver, not ADO. Probably it would be easier to use some "dirty trick" like a locking semaphore or sth like that, adapted to the engine. Regards
ADO Exclusive open
Carlos, I remember to read somewere that if you opend recorset and issue : begintrans immediatly after might be the same as USE .. EXCLUSIVE if you get an error USE fails if not the state of table would be protected untill you commit or abort trans. Do you have any experience on this?
ADO Exclusive open
As regards the first question: Please read more on SELECT ... FOR UPDATE available in Oracle, MySql and some others Please note that these are very rarely used. I strongly advise we need to unlearn DBF habits and re-orient our thinking. We can also open recordset with pessimistic locking and if we update a record, it is locked till unlocked. Concept of TRANSACTIONS is different. On quite a few occasions we need to update two or more tables for recording a single transaction. We need to either alter all the tables or none of the tables but can not leave some tables altered and some unaltered. For this purpose almost all SQL databases offer a construct like this. BEGIN TRANSACTION update table1 update table2, ........... etc if there is some problem ROLLBACK TRANSACTION else COMMIT TRANSACTION The programmer can decide either to COMMIT or ROLLBACK. Even hardware / power failures also perform an automatic ROLLBACK. ADO provides the same facility with oCn:BeginTrans() oCn:CommitTrans() oCn:RollBackTrans() Please note TDataRow class automatically implements this transactions feature if we use more than one table and enable oRec:lUseTrans is set to .T.
ADO Exclusive open
[quote="nageswaragunupudi":3atg4ft9] Please read more on SELECT ... FOR UPDATE available in Oracle, MySql and some others Please note that these are very rarely used. I strongly advise we need to unlearn DBF habits and re-orient our thinking.[/quote:3atg4ft9] I agree completly these are two completly diferent worlds. The question is that I m trying to buid an adordd emulating the dbfrdd to have it working with minor code changes in a huge an old application. [quote:3atg4ft9]We can also open recordset with pessimistic locking and if we update a record, it is locked till unlocked.[/quote:3atg4ft9] Wont do for me. [quote:3atg4ft9] Concept of TRANSACTIONS is different. On quite a few occasions we need to update two or more tables for recording a single transaction. We need to either alter all the tables or none of the tables but can not leave some tables altered and some unaltered. [/quote:3atg4ft9] Unfortunatly this application uses a lot of updates to several tables in a single TS. [quote:3atg4ft9] For this purpose almost all SQL databases offer a construct like this. BEGIN TRANSACTION update table1 update table2, ........... etc if there is some problem ROLLBACK TRANSACTION else COMMIT TRANSACTION The programmer can decide either to COMMIT or ROLLBACK. Even hardware / power failures also perform an automatic ROLLBACK. ADO provides the same facility with oCn:BeginTrans() oCn:CommitTrans() oCn:RollBackTrans() [/quote:3atg4ft9] This is what I want. But how do I know that the recordsets Im opening are all within same connection ? [quote:3atg4ft9] Please note TDataRow class automatically implements this transactions feature if we use more than one table and enable oRec:lUseTrans is set to .T.[/quote:3atg4ft9] I know but it doesnt solve my problem. Can I see the source to understand how recordsets are opened in the same connection? I take the opportunity to ask if you would help as SQL expert to translate fieldsizes and fielddec from sql o dbf in adordd.
ADO Exclusive open
Antonio, oRs:Fields( n ):DefinedSize Anyhow Mr. Rao is the real expert on ADO/SQL <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->
ADO Exclusive open
Antonio, This code is from FWH\source\function\adofunc.prg and it has been developed by Mr. Rao and surely will help you very much: [code=fw:29dol3f8]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">function</span> FWAdoFieldStruct<span style="color: #000000;">&#40;</span> oRs, n <span style="color: #000000;">&#41;</span> <span style="color: #B900B9;">// ( oRs, nFld ) where nFld is 1 based</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// ( oRs, oField ) or ( oRs, cFldName )</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #B900B9;">// ( oField )</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> oField, nType, uval<br />&nbsp; &nbsp;<span style="color: #00C800;">local</span> cType := <span style="color: #ff0000;">'C'</span>, nLen := <span style="color: #000000;">10</span>, nDec := <span style="color: #000000;">0</span>, lRW := .t. &nbsp;<span style="color: #B900B9;">// default</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> n == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; oField &nbsp; &nbsp; &nbsp;:= oRs<br />&nbsp; &nbsp; &nbsp; oRs &nbsp; &nbsp; &nbsp; &nbsp; := <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;elseif ValType<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'O'</span><br />&nbsp; &nbsp; &nbsp; oField &nbsp; &nbsp; &nbsp;:= n<br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> ValType<span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'N'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;n--<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">TRY</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;oField &nbsp; &nbsp; &nbsp;:= oRs:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span> n <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; CATCH<br />&nbsp; &nbsp; &nbsp; END<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> oField == <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">return</span> <span style="color: #00C800;">nil</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;nType &nbsp; &nbsp; &nbsp; := oField:<span style="color: #000000;">Type</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> nType == adBoolean<br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'L'</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := <span style="color: #000000;">1</span><br />&nbsp; &nbsp;elseif AScan<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adDate, adDBDate, adDBTime, adDBTimeStamp <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'D'</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := <span style="color: #000000;">8</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> oRs != <span style="color: #00C800;">nil</span> .and. ! oRs:<span style="color: #000000;">Eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> .and. ValType<span style="color: #000000;">&#40;</span> uVal := oField:<span style="color: #000000;">Value</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">'T'</span> .and. ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FW_TIMEPART<span style="color: #000000;">&#40;</span> uVal <span style="color: #000000;">&#41;</span> >= <span style="color: #000000;">1.0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cType &nbsp; &nbsp; &nbsp;:= <span style="color: #ff0000;">'T'</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;elseif AScan<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adTinyInt, adSmallInt, adInteger, adBigInt, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adUnsignedTinyInt, adUnsignedSmallInt, adUnsignedInt, ;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; adUnsignedBigInt <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'N'</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := oField:<span style="color: #000000;">Precision</span> + <span style="color: #000000;">1</span> &nbsp;<span style="color: #B900B9;">// added 1 for - symbol</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> oField:<span style="color: #000000;">Properties</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ISAUTOINCREMENT"</span> <span style="color: #000000;">&#41;</span>:<span style="color: #000000;">Value</span> == .t.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cType := <span style="color: #ff0000;">'+'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lRW &nbsp; := .f.<br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;elseif AScan<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adSingle, adDouble <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'N'</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">19</span>, oField:<span style="color: #000000;">Precision</span> + <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; nDec &nbsp; &nbsp; := <span style="color: #000000;">2</span><br />&nbsp; &nbsp;elseif nType == adCurrency<br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'N'</span> &nbsp; &nbsp; &nbsp;<span style="color: #B900B9;">// 'Y'</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := <span style="color: #000000;">19</span><br />&nbsp; &nbsp; &nbsp; nDec &nbsp; &nbsp; := <span style="color: #000000;">2</span><br />&nbsp; &nbsp;elseif AScan<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adDecimal, adNumeric, adVarNumeric <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'N'</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := <span style="color: #0000ff;">Max</span><span style="color: #000000;">&#40;</span> <span style="color: #000000;">19</span>, oField:<span style="color: #000000;">Precision</span> + <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> oField:<span style="color: #000000;">NumericScale</span> > <span style="color: #000000;">0</span> .and. oField:<span style="color: #000000;">NumericScale</span> < nLen<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nDec &nbsp;:= oField:<span style="color: #000000;">NumericScale</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;elseif AScan<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adBSTR, adChar, adVarChar, adLongVarChar, adWChar, adVarWChar, adLongVarWChar <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := oField:<span style="color: #000000;">DefinedSize</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nType != adChar .and. nType != adWChar .and. nLen > nFWAdoMemoSizeThreshold<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cType := <span style="color: #ff0000;">'M'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLen &nbsp;:= <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;elseif AScan<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adBinary, adVarBinary, adLongVarBinary <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; nLen &nbsp; &nbsp; := oField:<span style="color: #000000;">DefinedSize</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nType != adBinary .and. nLen > nFWAdoMemoSizeThreshold<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cType := <span style="color: #ff0000;">'m'</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLen &nbsp;:= <span style="color: #000000;">10</span><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;elseif AScan<span style="color: #000000;">&#40;</span> <span style="color: #000000;">&#123;</span> adChapter, adPropVariant <span style="color: #000000;">&#125;</span>, nType <span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; cType &nbsp; &nbsp;:= <span style="color: #ff0000;">'O'</span><br />&nbsp; &nbsp; &nbsp; lRW &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; lRW &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> lAnd<span style="color: #000000;">&#40;</span> oField:<span style="color: #000000;">Attributes</span>, 0x72100 <span style="color: #000000;">&#41;</span> .or. ! lAnd<span style="color: #000000;">&#40;</span> oField:<span style="color: #000000;">Attributes</span>, <span style="color: #000000;">8</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; lRW &nbsp; &nbsp; &nbsp;:= .f.<br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br /><span style="color: #00C800;">return</span> <span style="color: #000000;">&#123;</span> oField:<span style="color: #0000ff;">Name</span>, cType, nLen, nDec, nType, lRW <span style="color: #000000;">&#125;</span></div>[/code:29dol3f8]
ADO FILTER BOOLEAN EXPRESSION
Hello , Testing ADO oRs:Field := cExpression I found some difficulties : oRS.FILTER := "FIRST='Jon' OR (Married=0 AND LAST LIKE 'D*')"// Accepted oRS.FILTER := FIRST='Jon' OR Married=0 AND LAST LIKE 'D*'" // NOT ACCEPTED oRS.FILTER := "(FIRST='Jon' OR Married=0) AND LAST LIKE 'D*'" // NOT ACCEPTED oRS.FILTER := "LAST LIKE 'D*' AND FIRST='Jon' OR Married=0" // NOT ACCEPTED oRS.FILTER := "LAST LIKE 'D*' AND (FIRST='Jon' OR Married=0)" // NOT ACCEPTED Why is only the first expression accepted ? Espacially why the third or fifth not ? It seems that only the first one is accepted , how do we know where to place ( and ) ? Frank
ADO FILTER BOOLEAN EXPRESSION
I had the same problem [url:2a9to7wr]http&#58;//forums&#46;fivetechsupport&#46;com/viewtopic&#46;php?f=3&t=35944[/url:2a9to7wr] Here is the documentation of the filter [url:2a9to7wr]https&#58;//docs&#46;microsoft&#46;com/en-us/sql/ado/reference/ado-api/filter-property?view=sql-server-2017[/url:2a9to7wr]
ADO Filtering - Mr. Nages and others
Hello, We are almost finishing ADORDD, but there is a problem converting some filters from Clipper sinatx to ADO Filter command: The problem is with the vars (oData:Codigo, cName)...: [code=fw:21u412qf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; SET FILTER <span style="color: #0000ff;">TO</span> FIELD->NAME = cName<br />&nbsp; SET FILTER <span style="color: #0000ff;">TO</span> AUXILIAR->RELACION &nbsp;== alltrim<span style="color: #000000;">&#40;</span> &nbsp;STR<span style="color: #000000;">&#40;</span> oData:<span style="color: #000000;">Codigo</span> <span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />&nbsp;<br />&nbsp; cCondicion := <span style="color: #ff0000;">"CONTA->CUENTA = "</span> + chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">34</span> <span style="color: #000000;">&#41;</span> + alltrim<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> cCuentaoConcepto <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">34</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; cCondicion := <span style="color: #ff0000;">"CONTA->CONCEPTO = "</span> + chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">34</span> <span style="color: #000000;">&#41;</span> + alltrim<span style="color: #000000;">&#40;</span> cValToChar<span style="color: #000000;">&#40;</span> cCuentaoConcepto <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span> + chr<span style="color: #000000;">&#40;</span> <span style="color: #000000;">34</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp;</div>[/code:21u412qf] This is the parser to ADO: [code=fw:21u412qf]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;oRecordSet:<span style="color: #000000;">Filter</span> := SqlTranslate<span style="color: #000000;">&#40;</span>aFilterInfo<span style="color: #000000;">&#91;</span> UR_FRI_CEXPR <span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">STATIC</span> <span style="color: #00C800;">FUNCTION</span> SQLTranslate<span style="color: #000000;">&#40;</span> cFilter <span style="color: #000000;">&#41;</span><br />&nbsp; <span style="color: #00C800;">local</span> cWhere<br />&nbsp; <span style="color: #00C800;">local</span> nAt, nLen, cToken, cDate, n<br />&nbsp; <span style="color: #00C800;">local</span> afunctions := <span style="color: #000000;">&#123;</span><span style="color: #ff0000;">"STR("</span>,<span style="color: #ff0000;">"VAL("</span>,<span style="color: #ff0000;">"CVALTOCHAR("</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">'SOUNDEX('</span>, <span style="color: #ff0000;">"ABS("</span>,<span style="color: #ff0000;">"ROUND("</span>,<span style="color: #ff0000;">"LEN("</span>,<span style="color: #ff0000;">"ALLTRIM("</span>,<span style="color: #ff0000;">"LTRIM("</span>,<span style="color: #ff0000;">"RTRIM("</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"UPPER("</span>,<span style="color: #ff0000;">"LOWER("</span>,<span style="color: #ff0000;">"SUBSTR("</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"SPACE("</span>,<span style="color: #ff0000;">"DATE("</span>,<span style="color: #ff0000;">"YEAR("</span>,<span style="color: #ff0000;">"MONTH("</span>,;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #ff0000;">"DAY("</span>,<span style="color: #ff0000;">"TIME("</span>,<span style="color: #ff0000;">"IF("</span><span style="color: #000000;">&#125;</span><br />&nbsp; <span style="color: #00C800;">local</span> areplaces := <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">" LIKE "</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span>,<span style="color: #ff0000;">""</span><span style="color: #000000;">&#125;</span><br /><br />&nbsp; &nbsp;cWhere &nbsp; &nbsp; &nbsp;:= Upper<span style="color: #000000;">&#40;</span> cFilter <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cWhere &nbsp; &nbsp; &nbsp;:= StrTran<span style="color: #000000;">&#40;</span> StrTran<span style="color: #000000;">&#40;</span> cWhere, <span style="color: #ff0000;">"'"</span>, <span style="color: #ff0000;">"''"</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">'"'</span>, <span style="color: #ff0000;">"'"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cWhere &nbsp; &nbsp; &nbsp;:= StrTran<span style="color: #000000;">&#40;</span> StrTran<span style="color: #000000;">&#40;</span> cWhere, <span style="color: #ff0000;">".AND."</span>, <span style="color: #ff0000;">"AND"</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">".OR."</span>, <span style="color: #ff0000;">"OR"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cWhere &nbsp; &nbsp; &nbsp;:= StrTran<span style="color: #000000;">&#40;</span> StrTran<span style="color: #000000;">&#40;</span> cWhere, <span style="color: #ff0000;">".T."</span>, <span style="color: #ff0000;">"1"</span> <span style="color: #000000;">&#41;</span>, <span style="color: #ff0000;">".F."</span>, <span style="color: #ff0000;">"0"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cWhere &nbsp; &nbsp; &nbsp;:= StrTran<span style="color: #000000;">&#40;</span> cWhere, <span style="color: #ff0000;">"=="</span>, <span style="color: #ff0000;">"="</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cWhere &nbsp; &nbsp; &nbsp;:= StrTran<span style="color: #000000;">&#40;</span> cWhere, <span style="color: #ff0000;">"!="</span>, <span style="color: #ff0000;">"<>"</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cWhere &nbsp; &nbsp; &nbsp;:= StrTran<span style="color: #000000;">&#40;</span> cWhere, <span style="color: #ff0000;">"!"</span>, <span style="color: #ff0000;">" NOT "</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;cWhere &nbsp; &nbsp; &nbsp;:= StrTran<span style="color: #000000;">&#40;</span> cWhere, <span style="color: #0000ff;">Alias</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"->"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"!DELETED()"</span>, cWhere <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">1</span>; cWhere &nbsp; := LTrim<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cWhere, <span style="color: #000000;">11</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"AND"</span>, cWhere <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">1</span>; cWhere := LTrim<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cWhere, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"OR"</span>, cWhere <span style="color: #000000;">&#41;</span> == <span style="color: #000000;">1</span>; cWhere := LTrim<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cWhere, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span>; <span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">if</span> &nbsp;<span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"$"</span>,cWhere<span style="color: #000000;">&#41;</span> > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; cWhere := InvertArgs<span style="color: #000000;">&#40;</span>cWhere,<span style="color: #ff0000;">"$"</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp;<span style="color: #B900B9;">// Now handle dates its adpated from adofuncs because it was only considering one occurrence</span><br />&nbsp; &nbsp;<span style="color: #00C800;">do</span> <span style="color: #00C800;">while</span> .t.<br /><br />&nbsp; &nbsp; &nbsp; <span style="color: #00C800;">for</span> each cToken in <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"STOD("</span>, <span style="color: #ff0000;">"CTOD("</span>, <span style="color: #ff0000;">"HB_STOT("</span>, <span style="color: #ff0000;">"HB_CTOT("</span>, <span style="color: #ff0000;">"STOT("</span>, <span style="color: #ff0000;">"CTOT("</span>, <span style="color: #ff0000;">"{^"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nAt &nbsp; &nbsp;:= <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> cToken, cWhere <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> nat > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;exit<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nAt = <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit<br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br /><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">for</span> each cToken in <span style="color: #000000;">&#123;</span> <span style="color: #ff0000;">"STOD("</span>, <span style="color: #ff0000;">"CTOD("</span>, <span style="color: #ff0000;">"HB_STOT("</span>, <span style="color: #ff0000;">"HB_CTOT("</span>, <span style="color: #ff0000;">"STOT("</span>, <span style="color: #ff0000;">"CTOT("</span>, <span style="color: #ff0000;">"{^"</span> <span style="color: #000000;">&#125;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nAt &nbsp; &nbsp;:= <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> cToken, cWhere <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">if</span> nAt > <span style="color: #000000;">0</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cToken, <span style="color: #000000;">1</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"{"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLen &nbsp;:= <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"}"</span>, <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cWhere, nAt <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">else</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nLen &nbsp;:= <span style="color: #00C800;">At</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">")"</span>, <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cWhere, nAt <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cDate := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cWhere, nAt, nLen <span style="color: #000000;">&#41;</span><br />#ifdef __XHARBOUR__<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cDate, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> == <span style="color: #ff0000;">"HB_"</span>; cDate := <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cDate, <span style="color: #000000;">4</span> <span style="color: #000000;">&#41;</span>; <span style="color: #00C800;">endif</span><br />#else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cDate, <span style="color: #000000;">5</span> <span style="color: #000000;">&#41;</span> $ <span style="color: #ff0000;">"STOT(,CTOT("</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cDate &nbsp; &nbsp;:= <span style="color: #ff0000;">"HB_"</span> + cDate<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">if</span> <span style="color: #0000ff;">Left</span><span style="color: #000000;">&#40;</span> cDate, <span style="color: #000000;">2</span> <span style="color: #000000;">&#41;</span> = <span style="color: #ff0000;">"{^"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cDate &nbsp; &nbsp;:= LTrim<span style="color: #000000;">&#40;</span> <span style="color: #0000ff;">SubStr</span><span style="color: #000000;">&#40;</span> cDate, <span style="color: #000000;">3</span> <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cDate &nbsp; &nbsp;:= <span style="color: #00C800;">If</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">':'</span> $ cDate, <span style="color: #ff0000;">"HB_STOT('"</span>, <span style="color: #ff0000;">"HB_STOD('"</span> <span style="color: #000000;">&#41;</span> + cDate + <span style="color: #ff0000;">"')"</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;cDate &nbsp; &nbsp;:= CharRem<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"/-:} "</span>, cDate <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #00C800;">endif</span><br /><br />#endif<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cDate &nbsp;:= &cDate<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cWhere := Stuff<span style="color: #000000;">&#40;</span> cWhere, nAt, nLen, &nbsp;DateToADO<span style="color: #000000;">&#40;</span> cDate <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">endif</span><br />&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #00C800;">next</span><br />&nbsp; &nbsp;<span style="color: #00C800;">enddo</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">for</span> n:= <span style="color: #000000;">1</span> <span style="color: #0000ff;">to</span> len<span style="color: #000000;">&#40;</span>afunctions<span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp; &nbsp; &nbsp;cWhere := StrTran<span style="color: #000000;">&#40;</span> cWhere, afunctions<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span>, areplaces<span style="color: #000000;">&#91;</span>n<span style="color: #000000;">&#93;</span> <span style="color: #000000;">&#41;</span><br /><br />&nbsp; &nbsp;<span style="color: #00C800;">next</span><br /><br />&nbsp; &nbsp;cWhere &nbsp; &nbsp; &nbsp;:= StrTran<span style="color: #000000;">&#40;</span> cWhere, <span style="color: #ff0000;">")"</span>, <span style="color: #ff0000;">""</span> <span style="color: #000000;">&#41;</span><br /><br /><br /><span style="color: #00C800;">return</span> cWhere<br /><br /><br />&nbsp;</div>[/code:21u412qf] Any clue please?. Thank you.
ADO Filtering - Mr. Nages and others
Translating a filter condition when the condition contains harbour variables seems to be difficult. I could not find a way. So the present FW_Filter2Where() function returns valid condition only if the filter condition contains constants only and not variables. The author of SQLRDD did an extremely wonderful job. It may be worth seeing how did he handle this.
ADO Filtering - Mr. Nages and others
Mr. Nages, Thank you. Are you refering to SQLRDD from xHarbour.com?. I am afraid the source code is not available. SO far, the only way would be to rewrite all filters to this: [code=fw:2vh3gg6j]<div class="fw" id="{CB}" style="font-family: monospace;"><br /><br />cFiltro := <span style="color: #ff0000;">"NIF = '"</span> + ALLTRIM<span style="color: #000000;">&#40;</span> cNif<span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"'"</span><br />bFiltro := <span style="color: #ff0000;">"{|| "</span> + cFiltro +<span style="color: #ff0000;">"}"</span><br /><br />DBSETFILTER<span style="color: #000000;">&#40;</span> &bFiltro, cFiltro <span style="color: #000000;">&#41;</span> <br /><br />&nbsp;</div>[/code:2vh3gg6j] Any other approach?. Thank you.
ADO Filtering - Mr. Nages and others
Hello, I also posted on the Harbour and xHarbour developers group to get their kind help: <!-- m --><a class="postlink" href="https://groups.google.com/forum/#!topic/comp.lang.xharbour/Dbfq-Zydz0I">https://groups.google.com/forum/#!topic ... bfq-Zydz0I</a><!-- m --> <!-- m --><a class="postlink" href="https://groups.google.com/forum/#!topic/harbour-devel/Gsz0_vb8hh8">https://groups.google.com/forum/#!topic ... sz0_vb8hh8</a><!-- m -->
ADO MS SQL
I use sql and ado to talk to a database on MS Sql ServerI need some info :I need an instruction to put in a array the name of all the tables (files) located in one database .For a table, i want to know the number of records .I also want to know the number of fields, name of fields , type ans size .How to with ado syntax ?Thanks Ph Jacquet (Belgium)
ADO MS SQL
JACKTake a look at my CLASS, "ADOBASE".There you have all you want to do.There's an exe with its source code, and the class.Download it from <!-- m --><a class="postlink" href="http://200.72.140.34/privado">http://200.72.140.34/privado</a><!-- m --> The file is ADOBASE.RARFrom ChileAdolfo
ADO MS SQL
Yes I used it, nice <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D --> Thanks AdolforegardsFafi
ADO MYSQL se cae con 2 usuarios modificando mismo registro
Ayuda Estimados, Tengo una aplicacion con ADO y MySql todo va bién hasta que 2 usuarios modifican el mismo registro del recordset, y ahi el programa se cae en el usuario que grabó al final. GRACIAS de antemano por cualquier ayuda. estoy definiedo el bloqueo como sale a continuación: oCmd := TOLEAUTO():New("adodb.command") oCmd :ActiveConnection(oCon) oRS := TOleAuto():New("adodb.recordset") oRS :CursorLocation := adUseClient oRS :LockType := adLockOptimistic <------------ TIPO DE BLOQUEO oRS :CursorType := adOpenKeyset oRs:ActiveConnection(oCon) oRs:Source := "SELECT * FROM clientes ORDER BY NomCuenta "
ADO MYSQL se cae con 2 usuarios modificando mismo registro
Update operation by a user fails if another user updated the record after the user read the recordset and before updating. This is concurrency error. It is desirable that we should ascertain that the row is not updated by other users before calling oRs:Update() method. Normally oRs:Resync( adAffectCurrent, adResyncUnderlyingValues ) method helps us to know this. But unfortunately not all providers support this method. I very much doubt if Resync(...) is available for ADO MySql, particularly because ODBC is used. Only remaining alternative is to use the crude TRY .. CATCH .. END. We may examine the ADO error object to make sure it is the concurrency issue. If the Update fails, ReQuery() the recordset, inform the user about the concurrency issue and offer to re-edit. Note on: oRS :CursorType := adOpenKeyset When we open a recordset on the client side (this is what we should do) there is no use of assigning any values like adOpenKeyset or adOpenDynamic. Whatever we want ADO always opens the recordset with CursorType static only.
ADO MYSQL se cae con 2 usuarios modificando mismo registro
Lafug and Rao Rao .. you are VERY correct about ReSync() not being universally supported by some Databases .. like Access for example which causes difficulties in networked environments specifically when it comes to workstation updates and visibility. As far as concurrency I use a signature field in my tables called "Updated" which I increment each time a record has been modified. Before I commit any record .. I fire off a separate recordset back to the master table looking just for the primary key ( row id ) and the "updated" field .. if the buffered up record has the same value as the the table .. I commit the record .. if the master table has a greater value than the buffered 'updated' variable .. I assume someone has slipped behind the user and made a change to the same record therefore making the record about to be saved obsolete. In many cases ReQuery() is not an option because of how xbrowse saves bookmarks .. and issuing a Requery() and moving back to the same row in xbrowse is not possible. Struggling with Access and workstation visibility and concurrency myself .. I would much rather use Sql Server .. Rick Lipkin
ADO MYSQL se cae con 2 usuarios modificando mismo registro
Yes Mr Rick. I agree with you. ADO and MsSql are like made for each other. Baring a few issues Oracle also works quite well. There could be several strategies a programmer can adopt to handle concurrency issues, but all these involve rereading some data from the server just before writing and in all these cases one has to face the possibility of another committing a change in that minute fraction of a second unless pessimistic locking is used and row is locked. With optimistic locking, finally we need to attempt write and handle the failure finally in some way or other. Even if the probability is very low, our code should contain handling of failure. May be, TDolphin makes these issues quite simple to handle. I don't have any experience.
ADO MYSQL se cae con 2 usuarios modificando mismo registro
Ayuda Estimados, Tengo una aplicacion con ADO y MySql todo va bién hasta que 2 usuarios modifican el mismo registro del recordset, y ahi el programa se cae en el usuario que grabó al final. GRACIAS de antemano por cualquier ayuda. estoy definiedo el bloqueo como sale a continuación: oCmd := TOLEAUTO():New("adodb.command") oCmd :ActiveConnection(oCon) oRS := TOleAuto():New("adodb.recordset") oRS :CursorLocation := adUseClient oRS :LockType := adLockOptimistic <------------ TIPO DE BLOQUEO oRS :CursorType := adOpenKeyset oRs:ActiveConnection(oCon) oRs:Source := "SELECT * FROM clientes ORDER BY NomCuenta "
ADO MYSQL se cae con 2 usuarios modificando mismo registro
Luis, ¿ Que mensaje te muestra el ado ?, te comento que yo tengo sistemas con ado y mysql con hasta 20 usuarios concurrentes sin problemas. Atte., Lautaro Moreira
ADO MYSQL se cae con 2 usuarios modificando mismo registro
Lautaro, (mi correo:luisalfonsofuentesg@gmail.com para una asesoria $$ ?) Este es el error: Application =========== Path and name: C:\SISTEMAS\TARGET\SISGES.Exe (32 bits) Size: 2,473,984 bytes Time from start: 0 hours 4 mins 52 secs Error occurred at: 13/10/2011, 15:37:41 Error description: Error adodb.recordset/6 DISP_E_UNKNOWNNAME: MOVE Args: [ 1] = N 0 Stack Calls =========== Called from: source\rtl\win32ole.prg => TOLEAUTO:MOVE(0) Called from: C:\SISTEMAS\TARGET\mancli.prg => SKIPPER(167) Called from: C:\SISTEMAS\TARGET\mancli.prg => (b)MANCLI(98) Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:SKIP(1733) Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:PAINT(757) Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:DISPLAY(2277) Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1630) Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:HANDLEEVENT(1656) Called from: .\source\classes\WINDOW.PRG => _FWH(3443) Called from: => DIALOGBOXINDIRECT(0) Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(277) Called from: .\source\function\ERRSYSW.PRG => ERRORDIALOG(394) Called from: .\source\function\ERRSYSW.PRG => (b)ERRORSYS(31) Called from: source\rtl\win32ole.prg => TOLEAUTO:_SORT(0) Called from: C:\SISTEMAS\TARGET\mancli.prg => EDITA_MAR(242) Called from: C:\SISTEMAS\TARGET\mancli.prg => (b)MANCLI(87) Called from: .\source\classes\WINDOW.PRG => TWINDOW:LDBLCLICK(1902) Called from: .\source\classes\CONTROL.PRG => TCONTROL:LDBLCLICK(1685) Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:LDBLCLICK(1114) Called from: => TWINDOW:HANDLEEVENT(0) Called from: .\source\classes\CONTROL.PRG => TCONTROL:HANDLEEVENT(1670) Called from: .\source\classes\WBROWSE.PRG => TWBROWSE:HANDLEEVENT(1656) Called from: .\source\classes\WINDOW.PRG => _FWH(3443) Called from: => DIALOGBOX(0) Called from: .\source\classes\DIALOG.PRG => TDIALOG:ACTIVATE(277) Called from: C:\SISTEMAS\TARGET\mancli.prg => MANCLI(130) Called from: C:\SISTEMAS\TARGET\sisges.prg => (b)MAIN(198) Called from: .\source\classes\TOOLBAR.PRG => TTOOLBAR:COMMAND(219) Called from: .\source\classes\WINDOW.PRG => TWINDOW:COMMAND(1051) Called from: => TWINDOW:HANDLEEVENT(0) Called from: .\source\classes\WINDOW.PRG => _FWH(3443) Called from: => WINRUN(0) Called from: .\source\classes\WINDOW.PRG => TWINDOW:ACTIVATE(995) Called from: C:\SISTEMAS\TARGET\sisges.prg => MAIN(262) Called from: C:\SISTEMAS\TARGET\sisges.prg => INICIO(107) este es el codigo de la rutina de grabación: [code=fw:10tme7jn]<div class="fw" id="{CB}" style="font-family: monospace;">    <br />        <span style="color: #00C800;">IF</span> lNuevo<br />             oRS:<span style="color: #000000;">AddNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />        <span style="color: #00C800;">ENDIF</span><br /><br />        nBookMark:=oRs:<span style="color: #000000;">BookMark</span>                                            <br />        oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"nomcuenta"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>     := cliente<br />        oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"nomcontacto"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>  := contacto<br />        oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"cargo"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>             := cargo<br />        oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"email1email2"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span> := email1_2<br />        oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"telefono"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>        := telefono<br />        oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"direccion"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>       := direccion<br />        oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"pais"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>               := pais<br />        oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ciudad"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>           := ciudad<br />        oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"asignado_a"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>    := asignadoa<br />        oRS:<span style="color: #000000;">Sort</span>:=<span style="color: #ff0000;">"nomcuenta"</span><br /><br />        oRs:<span style="color: #000000;">BookMark</span>:=nBookMark                                            <br />                                                          <br /><br />        oRS:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /> </div>[/code:10tme7jn]
ADO MYSQL se cae con 2 usuarios modificando mismo registro
Luis El [code=fw:9asdtso9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; &nbsp;... <br />&nbsp; &nbsp;oRs:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />&nbsp; &nbsp;...<br />&nbsp;</div>[/code:9asdtso9] muevelo a antes de [code=fw:9asdtso9]<div class="fw" id="{CB}" style="font-family: monospace;"><br />&nbsp; ...<br />&nbsp; oRs:<span style="color: #000000;">Sort</span>:=<span style="color: #ff0000;">"nomcuenta"</span><br />&nbsp; ...<br />&nbsp;</div>[/code:9asdtso9] No puedes mover la posicion del recordset antes de hacer el update, ya que el move implica update y luego haces el update nuevamente y ahi salta el error. Saludos, Lautaro Moreira
ADO MYSQL se cae con 2 usuarios modificando mismo registro
GRacias Lautaro, pero se me cae igual:( [code=fw:25sozvda]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">IF</span> lNuevo<br />     oRS:<span style="color: #000000;">AddNew</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br />nBookMark:=oRs:<span style="color: #000000;">BookMark</span>                        <br />oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"nomcuenta"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>       := cliente<br />oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"nomcontacto"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>     := contacto<br />oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"cargo"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>           := cargo<br />oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"email1email2"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>    := email1_2<br />oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"telefono"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>        := telefono<br />oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"direccion"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>     := direccion<br />oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"pais"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>          := pais<br />oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"ciudad"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>        := ciudad<br />oRS:<span style="color: #000000;">Fields</span><span style="color: #000000;">&#40;</span><span style="color: #ff0000;">"asignado_a"</span><span style="color: #000000;">&#41;</span>:<span style="color: #000000;">value</span>    := asignadoa<br />oRS:<span style="color: #0000ff;">Update</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oRS:<span style="color: #000000;">Sort</span>:=<span style="color: #ff0000;">"nomcuenta"</span><br /><br />oRs:<span style="color: #000000;">BookMark</span>:=nBookMark                        <br /> </div>[/code:25sozvda]
ADO MYSQL se cae con 2 usuarios modificando mismo registro
Lafug. Local oErrorAdo ... ... ... ... ... ... TRY oRs:Update() CATCH oErrorAdo MsgAlert(oErrorAdo) END Con esto capturas el error desde ADO y puedes ver que es lo que realmente esta sucediendo. Seria bueno que copiaras aqui la estructura de la tabla completa, y supongo que lo que estas grabando pertenece solo a una tabla ? Saludos
ADO Ms Access Filter Condition
To All I have a Sql statement that runs fine using the Ms Access instr() function and I am trying to modify the script to a filter condition... This is the Sql statement that runs from the Open() line : [code=fw:19up7w7d]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cSQL := <span style="color: #ff0000;">"SELECT * FROM REQUEST where instr(PARTDESC,'ba') > 0"</span> <br /><br />oRsReq := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRsReq:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRsReq:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />oRsReq:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br /><span style="color: #00C800;">TRY</span><br />  oRsReq:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span>cSQL,xConnect <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />  <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening REQUEST table"</span> <span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /> </div>[/code:19up7w7d] Unfortunately, I can not translate it to a filter condition : oRsReq:Filter := "" oRsReq:Filter := "instr(PARTDESC,'ba') > 0" Errors with : Application =========== Path and name: C:\Fox\SourceParts\SourceW32.Exe (32 bits) Size: 2,086,912 bytes Time from start: 0 hours 0 mins 1 secs Error occurred at: 12/09/2011, 14:25:44 Error description: Error ADODB.Recordset/6 DISP_E_UNKNOWNNAME: _FILTER Args: [ 1] = C instr(PARTDESC,'ba') > 0 Any ideas from anyone on how I can make this filter condition work ? Thanks Rick Lipkin
ADO Ms Access Filter Condition
Try this sql string cSQL := "SELECT * FROM REQUEST where PARTDESC like '%ba%'"
ADO Ms Access Filter Condition
Gale Your suggestion was correct .. oRsReq:Filter := "PARTDESC like '%ba%'" .. For some reason I just had a 'brain freeze' and was thinking like the AT() function .. Thanks Rick Lipkin
ADO Ms Access SLow Close() and Re-Open tables on Win 7
To All I have a Customer Module that Opens 3 tables from a MS Access database and when I chose a different customer the tables get refreshed by closing them and re-opening them( _custedit() ). The close and re-open process works GREAT on 32 bit Windows XP, but times out on the re-open [Customer Item] table and breaks in the _CustEdit Function. Here is the code .. all the oRs variables were defined local at the top of the program and passed normally thru the various Functions. Again, this code works flawlessly on WinXP .. but 'barfs' using Windows 7. I have tried to stay away from using Static oRs variables because this is a MDI application and if the Customer module is opened twice on I have memory 'bleed thru' problems between Customer modules. Any advice would be welcome .. Rick Lipkin [code=fw:7vxng2vg]<div class="fw" id="{CB}" style="font-family: monospace;"><br />/Top <span style="color: #0000ff;">of</span> Customer module<br /><span style="color: #B900B9;">//------------------------</span><br />Func _CustView<span style="color: #000000;">&#40;</span> cMode,oWndMain <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Local</span> oDlg,lOk1,cSay,oSay,cDefa<br /><span style="color: #00C800;">Local</span> oRsCust,oRsInvoice,oRsShip,oRsItem<br /><br />oRsCust     := <span style="color: #ff0000;">" "</span><br />oRsInvoice  := <span style="color: #ff0000;">" "</span><br />oRsShip     := <span style="color: #ff0000;">" "</span><br />oRsItem     := <span style="color: #ff0000;">" "</span><br /><br /><br />cDEFA := SET<span style="color: #000000;">&#40;</span><span style="color: #000000;">7</span><span style="color: #000000;">&#41;</span><br /><br />LightGreyGrad<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />lOK1   := .F.<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"FILECHK"</span>       ;<br />       <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Please be patient"</span><br /><br />       cSAY :=  <span style="color: #ff0000;">"Opening Tables"</span><br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">var</span> cSay <span style="color: #0000ff;">ID</span> <span style="color: #000000;">120</span> <span style="color: #0000ff;">of</span> oDLG <span style="color: #0000ff;">UPDATE</span><br /><br />       oDLG:<span style="color: #000000;">bStart</span> := <span style="color: #000000;">&#123;</span> || lOK1 := _OpenUm0<span style="color: #000000;">&#40;</span> oDLG,oSAY,@cSAY,@oRsCust,@oRsInvoice,@oRsShip,@oRsItem <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDLG <span style="color: #0000ff;">CENTERED</span><br /><br />oSay := <span style="color: #00C800;">NIL</span><br />cSay := <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">IF</span> lOK1 = .F.<br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span><span style="color: #00C800;">NIL</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br />_CustView1<span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"A"</span>,oWndMain,oRsCust,oRsInvoice,oRsShip,oRsItem<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//----------------</span><br /><span style="color: #00C800;">Static</span> Func _OpenUm0<span style="color: #000000;">&#40;</span> oDlg, oSay,cSay, oRsCust,oRsInvoice,oRsShip,oRsItem <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Local</span> cSql,oErr<br /><br />cSay := <span style="color: #ff0000;">"Opening Customer Table"</span><br />oSay:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">// relational key</span><br /><br />cSQL := <span style="color: #ff0000;">"SELECT * from CUSTOMER order by [Last Name],[First Name]"</span><br /><br />oRsCust := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRsCust:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRsCust:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />oRsCust:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br /><span style="color: #00C800;">TRY</span><br />   oRsCust:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xCONNECT <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening CUSTOMER table"</span> <span style="color: #000000;">&#41;</span><br />   oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br />oRsCust:<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">""</span><br />oRsCust:<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">"[Last Name] = 'bogus'"</span><br /><br /><span style="color: #B900B9;">// service address tab</span><br />cSay := <span style="color: #ff0000;">"Opening Customer ShipTo Table"</span><br />oSay:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />cSQL := <span style="color: #ff0000;">"SELECT * from [CUSTOMER SHIPTO] where 1 = 2 order by [Customer Id], [Address1]"</span><br /><br />oRsShip := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRsShip:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRsShip:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />oRsShip:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br /><span style="color: #00C800;">TRY</span><br />   oRsShip:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xCONNECT <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />   oRsCust:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening CUSTOMER SHIPTO table"</span> <span style="color: #000000;">&#41;</span><br />   oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br /><span style="color: #B900B9;">// electronics tab</span><br />cSay := <span style="color: #ff0000;">"Opening Customer Item Table"</span><br />oSay:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />cSql := <span style="color: #ff0000;">"SELECT "</span><br />cSql += <span style="color: #ff0000;">"[Key],[Customer Id],[Model Number],[Manufacturer Name],[Product Class],[Serial Number] "</span><br />cSql += <span style="color: #ff0000;">"From [Customer Item] "</span><br />cSql += <span style="color: #ff0000;">"Where 1 = 2 Order by [Customer Id],[Serial Number]"</span><br /><br />oRsItem := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRsItem:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRsItem:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />oRsItem:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br /><span style="color: #00C800;">TRY</span><br />   oRsItem:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xCONNECT <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />   oRsCust:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oRsShip:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening CUSTOMER ITEM table"</span> <span style="color: #000000;">&#41;</span><br />   oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br /><span style="color: #B900B9;">// invoice table</span><br />cSay := <span style="color: #ff0000;">"Opening Invoice Table"</span><br />oSay:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />cSql := <span style="color: #ff0000;">"SELECT "</span><br />cSql += <span style="color: #ff0000;">"[Repair Number], [Transaction Type], [Customer Id],[Invoiced Date], "</span><br />cSql += <span style="color: #ff0000;">"[Total], [Balance] "</span><br />cSql += <span style="color: #ff0000;">"From Invoice where 1 = 2 Order by [Invoiced Date] DESC"</span><br /><br />oRsInvoice := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"ADODB.Recordset"</span> <span style="color: #000000;">&#41;</span><br />oRsInvoice:<span style="color: #000000;">CursorType</span>     := <span style="color: #000000;">1</span>        <span style="color: #B900B9;">// opendkeyset</span><br />oRsInvoice:<span style="color: #000000;">CursorLocation</span> := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// local cache</span><br />oRsInvoice:<span style="color: #000000;">LockType</span>       := <span style="color: #000000;">3</span>        <span style="color: #B900B9;">// lockoportunistic</span><br /><br /><span style="color: #00C800;">TRY</span><br />   oRsInvoice:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xCONNECT <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />   oRsCust:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oRsShip:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oRsItem:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening INVOICE table"</span> <span style="color: #000000;">&#41;</span><br />   oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br />oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//-------------------------------</span><br />FUNC _Custview1<span style="color: #000000;">&#40;</span> cMODE,oWnd,oRsCust,oRsInvoice,oRsShip,oRsItem <span style="color: #000000;">&#41;</span><br /><br />...<br />...<br />...<br /><span style="color: #B900B9;">// double click on xBrowse new Customer and I close and reopen the tables and here</span><br /><span style="color: #B900B9;">// is where I have problems</span><br /><br />oLbx:<span style="color: #000000;">bLDblClick</span> := <span style="color: #000000;">&#123;</span> |nRow,nCol | _CustEdit<span style="color: #000000;">&#40;</span> oRsCust,oRsShip,oRsItem,oRsInvoice,cCustomerId ..... <span style="color: #000000;">&#41;</span><br /><br />...<br />...<br /><br /><br /><br /><span style="color: #B900B9;">//---------------------</span><br /><span style="color: #00C800;">Static</span> Func _CustEdit<span style="color: #000000;">&#40;</span> oRsCust,oRsShip,oRsItem,oRsInvoice,cCustomerId... more variables <span style="color: #000000;">&#41;</span><br /><br />...<br />_OpenUm<span style="color: #000000;">&#40;</span> oDLG,oSAY,cSAY,oRsItem,oRsInvoice,oRsShip,cCustomerId <span style="color: #000000;">&#41;</span><br />...<br />...<br /><br /><span style="color: #B900B9;">// sets up the recordset for this customer down stream</span><br /><span style="color: #B900B9;">//--------------------</span><br /><span style="color: #00C800;">Static</span> Func _OpenUm<span style="color: #000000;">&#40;</span> oDLG,oSAY,cSAY,oRsItem,oRsInvoice,oRsShip,cCustomerId <span style="color: #000000;">&#41;</span><br /><br />...<br />...<br /><br /><span style="color: #0000ff;">DEFINE</span> <span style="color: #0000ff;">DIALOG</span> oDlg <span style="color: #0000ff;">RESOURCE</span> <span style="color: #ff0000;">"FILECHK"</span>       ;<br />       <span style="color: #0000ff;">TITLE</span> <span style="color: #ff0000;">"Please be patient"</span><br /><br />       cSAY :=  <span style="color: #ff0000;">"Opening Tables"</span><br />       <span style="color: #0000ff;">REDEFINE</span> <span style="color: #0000ff;">SAY</span> oSay <span style="color: #0000ff;">var</span> cSay <span style="color: #0000ff;">ID</span> <span style="color: #000000;">120</span> <span style="color: #0000ff;">of</span> oDLG <span style="color: #0000ff;">UPDATE</span><br /><br />       oDLG:<span style="color: #000000;">bStart</span> := <span style="color: #000000;">&#123;</span> || lOK1 := _OpenUm<span style="color: #000000;">&#40;</span> oDLG,oSAY,@cSAY,oRsItem,oRsInvoice,oRsShip,cCustomerId <span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#125;</span><br /><br /><span style="color: #0000ff;">ACTIVATE</span> <span style="color: #0000ff;">DIALOG</span> oDLG <span style="color: #0000ff;">CENTERED</span><br /><br />oSay := <span style="color: #00C800;">NIL</span><br />cSay := <span style="color: #00C800;">NIL</span><br /><br /><span style="color: #00C800;">IF</span> lOK1 = .F.<br />    <span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.f.<span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">ENDIF</span><br /><br />   oLbxA:<span style="color: #000000;">MakeTotals</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>     <span style="color: #B900B9;">// invoices</span><br />   oLbxA:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oLbx2:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>        <span style="color: #B900B9;">// service items</span><br />   oLbx3:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>        <span style="color: #B900B9;">// service locations</span><br /><br /><span style="color: #00C800;">Endif</span><br /><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span><br /><br /><span style="color: #B900B9;">//--------------------------</span><br /><span style="color: #00C800;">Static</span> Func _OpenUm<span style="color: #000000;">&#40;</span> oDLG,oSAY,cSAY,oRsItem,oRsInvoice,oRsShip,cCustomerId <span style="color: #000000;">&#41;</span><br /><br /><span style="color: #00C800;">Local</span> cSql,oErr<br /><br />oRsItem:<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">""</span><br />oRsItem:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />oRsInvoice:<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">""</span><br />oRsInvoice:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oRsShip:<span style="color: #000000;">Filter</span> := <span style="color: #ff0000;">""</span><br />oRsShip:<span style="color: #000000;">CLose</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br /><br />cSay := <span style="color: #ff0000;">"Opening Item Customer ShipTo Table"</span><br />oSay:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />cSQL := <span style="color: #ff0000;">"SELECT * from [CUSTOMER SHIPTO] where [Customer Id] = '"</span>+alltrim<span style="color: #000000;">&#40;</span>cCustomerId<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"'"</span><br />cSql += <span style="color: #ff0000;">" order by [Customer Id], [Address1]"</span><br /><br /><span style="color: #00C800;">TRY</span><br />   oRsShip:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xCONNECT <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening CUSTOMER SHIPTO table"</span> <span style="color: #000000;">&#41;</span><br />   oDlg:<span style="color: #000000;">ENd</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br />cSay := <span style="color: #ff0000;">"Opening Invoice Table"</span><br />oSay:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />cSql := <span style="color: #ff0000;">"SELECT "</span><br />cSql += <span style="color: #ff0000;">"[Repair Number], [Transaction Type], [Customer Id],[Invoiced Date], "</span><br />cSql += <span style="color: #ff0000;">"[Total], [Balance] "</span><br />cSql += <span style="color: #ff0000;">"From Invoice Where [Customer Id] = '"</span>+alltrim<span style="color: #000000;">&#40;</span>cCustomerId<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"'"</span><br />cSql += <span style="color: #ff0000;">" Order by [Invoiced Date] DESC"</span><br /><br /><span style="color: #00C800;">TRY</span><br />   oRsInvoice:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xCONNECT <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening INVOICE table"</span> <span style="color: #000000;">&#41;</span><br />   oDlg:<span style="color: #000000;">ENd</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br /><span style="color: #B900B9;">////////////////////</span><br /><span style="color: #B900B9;">//////////////// locks up here on this table</span><br /><span style="color: #B900B9;">//////////////// only with Window 7</span><br /><span style="color: #B900B9;">/////////////////</span><br /><br />cSay := <span style="color: #ff0000;">"Opening Item Detail Table"</span><br />oSay:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><br />cSql := <span style="color: #ff0000;">"SELECT "</span><br />cSql += <span style="color: #ff0000;">"[Key],[Customer Id],[Model Number],[Manufacturer Name],[Product Class],[Serial Number] "</span><br />cSql += <span style="color: #ff0000;">"From [Customer Item] "</span><br />cSql += <span style="color: #ff0000;">"Where [Customer Id] = '"</span>+alltrim<span style="color: #000000;">&#40;</span>cCustomerId<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"' Order by [Customer Id],[Serial Number]"</span><br /><br /><span style="color: #00C800;">TRY</span><br />  oRsItem:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xCONNECT <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />  <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening CUSTOMER ITEM table"</span> <span style="color: #000000;">&#41;</span><br />  <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br />oDlg:<span style="color: #000000;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /><span style="color: #00C800;">Return</span><span style="color: #000000;">&#40;</span>.t.<span style="color: #000000;">&#41;</span><br /> </div>[/code:7vxng2vg] [img:7vxng2vg]http&#58;//i60&#46;tinypic&#46;com/2vabh4i&#46;jpg[/img:7vxng2vg]
ADO Ms Access SLow Close() and Re-Open tables on Win 7
Rick: Just an idea, I have not W7, what if you remove the refresh code [code=fw:ijl8i21a]<div class="fw" id="{CB}" style="font-family: monospace;"><br />cSay := <span style="color: #ff0000;">"Opening Item Customer ShipTo Table"</span><br />oSay:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>    <span style="color: #B900B9;">// This one</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>       <span style="color: #B900B9;">// And this one too</span><br /><br />cSQL := <span style="color: #ff0000;">"SELECT * from [CUSTOMER SHIPTO] where [Customer Id] = '"</span>+alltrim<span style="color: #000000;">&#40;</span>cCustomerId<span style="color: #000000;">&#41;</span>+<span style="color: #ff0000;">"'"</span><br />cSql += <span style="color: #ff0000;">" order by [Customer Id], [Address1]"</span><br /><br /><span style="color: #00C800;">TRY</span><br />   oRsShip:<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span> cSQL,xCONNECT <span style="color: #000000;">&#41;</span><br />CATCH oErr<br />   <span style="color: #0000ff;">MsgInfo</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">"Error in Opening CUSTOMER SHIPTO table"</span> <span style="color: #000000;">&#41;</span><br />   oDlg:<span style="color: #000000;">ENd</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">RETURN</span><span style="color: #000000;">&#40;</span>.F.<span style="color: #000000;">&#41;</span><br />END <span style="color: #00C800;">TRY</span><br /><br />cSay := <span style="color: #ff0000;">"Opening Invoice Table"</span><br />oSay:<span style="color: #0000ff;">ReFresh</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>     <span style="color: #B900B9;">// This one</span><br />SysReFresh<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>        <span style="color: #B900B9;">// And this one too</span><br /> </div>[/code:ijl8i21a] Regards
ADO Ms Access SLow Close() and Re-Open tables on Win 7
Armando I think I am going to revise my Customer screen and instead of opening 4 tables, just open the Customer and Invoice and have buttons for the other tables to click and open the other two tables on demand. I would still like to know why the my current code works GREAT on XP but hangs when closing and re-opening the same table(s) with the same fields with only a parameter change. Thanks Rick Lipkin
ADO Open Question
All, I want to open an ado connection to an access database using the adModeShareExclusive mode (12). Can someone give me an example for doing this? This is what I'm using now: oConn := CREATEOBJECT( "ADODB.Connection" ) oConn:Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+cDataSource) cDataSource is the path and name of my .mdb file. The above works fine. I can get the mode with oConn:Mode, which returns 16. However I cannot find the correct syntax to specify or set the mode. Thanks, Randal
ADO Open Question
Probably you are trying to set Mode property when the connection is open. From MSDN: [quote:37xe5ds7]You can set the Mode property only when the Connection object is closed.[/quote:37xe5ds7] EMG
ADO Open Question
Enrico, Thanks, that helps. Randal
ADO Problem
HI, This code sometimes work ok, sometimes produce error: Error description: Error ADODB.RecordSet/6 DISP_E_UNKNOWNNAME: MOVEFIRST [code=fw:1oauv2qz]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">try</span><br />   oRs := TOleAuto<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>:<span style="color: #00C800;">New</span><span style="color: #000000;">&#40;</span> <span style="color: #ff0000;">'ADODB.RecordSet'</span> <span style="color: #000000;">&#41;</span><br />   WITH OBJECT oRs<br />      :<span style="color: #000000;">ActiveConnection</span> := oCn<br />      :<span style="color: #000000;">Source</span>           := <span style="color: #ff0000;">'SELECT * from mytable'</span><br />      :<span style="color: #000000;">CursorLocation</span>   := <span style="color: #000000;">3</span>  <br />      :<span style="color: #000000;">Open</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   END<br />catch oErr<br />   FW_ShowAdoError<span style="color: #000000;">&#40;</span>oCn<span style="color: #000000;">&#41;</span><br />   <span style="color: #00C800;">return</span> .f.<br />end <span style="color: #00C800;">try</span><br /><br />oRs:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />.<br />.<br />.<br /><br />oRs:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />oCn:<span style="color: #000000;">Close</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br /> </div>[/code:1oauv2qz] After few days i have seen that it is huppaning when table is empty Is that mean that we must always control oRs:RecordCount ???? Is that standard ADO behavior or therw is some other solution ? Second case IF :Source is not SELECT statement for example :Source := 'SET PDQPRIORITY 95' than oRs:State = 0 and all Methods produce error ... Error description: Error ADODB.RecordSet/6 DISP_E_UNKNOWNNAME: CLOSE Question: IS sql statement executed ? IS that mean thet in this cases it is not need of closing recordset ? Must control oRs:State in any cases ? In this case [b:1oauv2qz]CATCH oErr[/b:1oauv2qz] dont report error ... ONE MORE Qusetion. If SQL statement is executed ... is server returning message what is maded ? Something like "100 Records inserted" If yes how can i get that message ? IS there some function like FW_ShowAdoResult(oCn) ? Best Regards,
ADO Problem
Avista, It's normal that you get an error if you do a oRs:MoveFirst() on a empty recordset. That's why I use [code=fw:37ebt5aw]<div class="fw" id="{CB}" style="font-family: monospace;"><span style="color: #00C800;">IF</span> !oRs:<span style="color: #000000;">eof</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   oRs:<span style="color: #000000;">MoveFirst</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />   ...<br /><br /><span style="color: #00C800;">ENDIF</span><br />&nbsp;</div>[/code:37ebt5aw] I don't know what you mean for the second case.
ADO Problem
cSql := "UPDATE ......" or "INSERT INTO ..." oCn:Execute( cSql, @nRows, adCmdText ) ? nRows
ADO Problem
Marc, Rao Thanks for reply Regards,
ADO QUESTION: using a Harbour function in a WHERE clause
Hello, I would like to use a Harbour function in a where clause. I need to pass to Harbour´s function the value from the SQL TABLE: cSQLi1 := "SELECT * FROM APUNTES WHERE MyFunction(FECHA) = '1' " That gives an error indicating that MyFunction is not defined on the SQL engine. So I tried with no luck "SELECT * FROM APUNTES WHERE "+ MyFunction( "+FECHA+" ) +" = '1' " But In MyFunction I don´t get FECHA value, I just retrieve +FECHA+ Any advice will be welcomed. Thank you very much. Best regards
ADO QUESTION: using a Harbour function in a WHERE clause
Lucas, Try: "SELECT * FROM APUNTES WHERE "+ MyFunction( FECHA ) +" = '1' "
ADO QUESTION: using a Harbour function in a WHERE clause
Thank you, but it does not work as FECHA must be returned from SQL, it is a field from the table (FECHA=Date)
ADO QUESTION: using a Harbour function in a WHERE clause
Ok, so I would do this way: MiFecha = MyFunction () // In MyFunction() I'd use the SELECT to get the field FECHA and do the necessary "SELECT * FROM APUNTES WHERE "+ MiFecha +" = '1' "
ADO QUESTION: using a Harbour function in a WHERE clause
Lucas: I do this way with xHarbour and MySql [code=fw:3ieu6bym]<div class="fw" id="{CB}" style="font-family: monospace;"><br />oRsHdr:<span style="color: #000000;">Source</span>               := <span style="color: #ff0000;">"SELECT "</span> +;<br />                                        <span style="color: #ff0000;">"HdrCot.*,"</span> +;<br />                                        <span style="color: #ff0000;">"Clientes.* "</span> +;<br />                                    <span style="color: #ff0000;">"FROM "</span> +;<br />                                        <span style="color: #ff0000;">"HdrCot "</span> +;<br />                                    <span style="color: #ff0000;">"LEFT JOIN "</span> +;<br />                                        <span style="color: #ff0000;">"Clientes "</span> +;<br />                                    <span style="color: #ff0000;">"ON "</span> +;<br />                                        <span style="color: #ff0000;">"HdrCot.Hdr_Cli = Clientes.Cli_Cli "</span> +;<br />                                    <span style="color: #ff0000;">"WHERE "</span> +;<br />                                        <span style="color: #ff0000;">"YEAR(Hdr_Fde) = '"</span> + STR<span style="color: #000000;">&#40;</span>nAmo,<span style="color: #000000;">4</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"' "</span> +;<br />                                    <span style="color: #ff0000;">"AND "</span> +;<br />                                        <span style="color: #ff0000;">"MONTH(Hdr_Fde) = '"</span> + STR<span style="color: #000000;">&#40;</span>nMes,<span style="color: #000000;">2</span>,<span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span> + <span style="color: #ff0000;">"' "</span> +;<br />                                    <span style="color: #ff0000;">"ORDER BY "</span> +;<br />                                        <span style="color: #ff0000;">"Hdr_Cot"</span><br /> </div>[/code:3ieu6bym] Regards
ADO QUESTION: using a Harbour function in a WHERE clause
Armando, Muchas gracias, pero no es lo que necesito, porque Month es una función de MySQL. Sin Embargo, no está presente en SQLite. Imagina que quieres usar otra función tuya. Muchas gracias en todo caso.
ADO QUESTION: using a Harbour function in a WHERE clause
Armando, Muchas gracias, pero no es lo que necesito, porque Month es una función de MySQL. Sin Embargo, no está presente en SQLite. Imagina que quieres usar otra función tuya. Muchas gracias en todo caso.
ADO QUESTION: using a Harbour function in a WHERE clause
If it is MySql, MsSql, Oracle etc I create a sql function on the server with the same functionality of MyFunction. SQL statements can use that function. I am not sure if SqLite allows creation of server-side procedures and functions. Another way is to maintain a calculated column in the same table which stores the same result as myfunction(fecha) in another column and use that column in the where clause.
ADO RDD connection error 16389
I have this error testing MS SQL and MySQL. Is there a way to get more information of the error. I have used this code with MySQL [code:1h7oj8pj]#Include "FiveWin&#46;Ch" #include "adordd&#46;ch" REQUEST ADORDD function TstMySql&#40;&#41; USE test1 VIA "ADORDD" TABLE "tabel1" MYSQL ; FROM "LOCALHOST" USER "ROOT" PASSWORD "" Browse&#40;&#41; USE return nil [/code:1h7oj8pj] Any idea Thanks, Willy Hermans
ADO RDD connection error 16389
Willy, Try to connect to your database and table using an application like Navicat (<!-- w --><a class="postlink" href="http://www.navicat.com">www.navicat.com</a><!-- w -->) and check if it works fine
ADO RDD connection error 16389
Thanks Antonio, I'll try it asap. The MySQL that I use is a version with PHP. It has already a management system. Is it possible that not all versions (i.e. version 5) are supported Thanks Willy Hermans
ADO RDD connection error 16389
I've just tested it with Navicat. The connection works fine. Greetings Willy
ADO RDD connection error 16389
Willy, > TABLE "tabel1" Isn't there a typo ? "table1" ?
ADO RDD connection error 16389
No tabel is just the dutch word for table Greetings Willy
ADO RDD connection error 16389
ok <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) --> Please try using "localhost" in lower case or 127.0.0.1
ADO RDD connection error 16389
After reinstalling MySQL and ODBC drivers the connection works Thanks. Willy
ADO RDD connection error 16389
Now I've tried to connect from another pc. This does still not work. I've tried with the ip adres of the pc that holds the mysql server software. I've tried with the networkname of the pc... I've tried with "\\pcname\localhost" and so on. What are exacly the possibilities for adressing the connection. Thanks, Willy Hermans MS-SQL works already from a network pc
ADO RDD connection error 16389
Willy, > What are exacly the possibilities for adressing the connection We don't know it for sure. ADORDD is just a layer that uses ADO. If ADO works then the ADORDD should work too.
ADO RDD connection error 16389
Thanks Fernando, I've done some tests. There seems to be something wrong with the MySQL server. I have reinstalled the server several times. When I use EasyPhp 1.7 or 1.8 (This includes MySQL 5) the program works local but the server is not detected at another PC in the network. I have used navicat and MySQL Administrator. Maybe the MySQL server is automatically installed as a local server. I can not find a setting to change that. When I do'nt use EasyPHP but the usual MySQL 5 the program does not work on any pc. In that case I have a connection error but the server is detected on other pc's. I think I have to search a forum for MySQL beginners. Someone any idea ? Thanks. Willy.
ADO RDD connection error 16389
I have just finished some tests. 1) Format C 2) Reinstall XP service pack 2 3) disable firewall 4) Install MySQL 5 run this code [code:fc8lfcxk]#Include "FiveWin&#46;Ch" #include "adordd&#46;ch" REQUEST ADORDD function TstMySql&#40;&#41; USE test VIA "ADORDD" TABLE "tabel1" MYSQL ; FROM "localhost" USER "root" password "ikke" * USE test00 VIA "ADORDD" TABLE "ACCOUNTS" MYSQL ; * FROM "www&#46;freesql&#46;org" USER "myuser" PASSWORD "mypass" Browse&#40;&#41; USE return nil[/code:fc8lfcxk] This works fine on the pc were MySQL is installed. It does not work on any other pc. So I changed "localhost" into "192.168.0.101" and "testpc" and "TESTPC" This did not work on any pc. But the error is different Now it is not a [b:fc8lfcxk]ADODB/Connection[/b:fc8lfcxk] error but it is a [b:fc8lfcxk]ADODB Recordset[/b:fc8lfcxk] error. With Navicat it was easy to open as "testpc" , "TESTPC" , "192.168.0.101" Is it possible that this is not yet supported in ADORDD Thanks, Willy Hermans[/code]
ADO RDD connection error 16389
Willy, Please show us your code using "testpc"
ADO RDD connection error 16389
Hello Antonio, Here it is. [code:1g8211a0]#include "adordd&#46;ch" REQUEST ADORDD function TstMySql&#40;&#41; USE test VIA "ADORDD" TABLE "tabel1" MYSQL ; FROM "testpc" USER "root" password "pas" * USE test00 VIA "ADORDD" TABLE "ACCOUNTS" MYSQL ; * FROM "www&#46;freesql&#46;org" USER "myuser" PASSWORD "mypass" Browse&#40;&#41; USE return nil[/code:1g8211a0] Greetings Willy Hermans
ADO RDD xHarbour
Hello, Is there a stable Rdd for ADO working for basic operations such as replaces, browses, like other rdds? Regards Antonio
ADO RDD xHarbour
Antonio, You don't need a RDD. Please review these easy examples: [url:2rmtf3tf]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=ado_create_database[/url:2rmtf3tf] [url:2rmtf3tf]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=ado_import_dbf[/url:2rmtf3tf] [url:2rmtf3tf]http&#58;//wiki&#46;fivetechsoft&#46;com/doku&#46;php?id=ado_mdi_browse[/url:2rmtf3tf]
ADO RDD xHarbour
Antonio, I work already with ADO that way, however I'm converting an old and large application with FW and xHarbour and the way app is desinged it will be vey time consuming to make that approach. The app doesnt has any kind of Tdata objects to encapsulate the Skips, replaces etc that are spreaded all around the code. I have a low budget for this work so my idea is to using an rdd. Meanwhile I've found out ADORDD from 2007. It seems to me that all these basics actions are covered. Do you think that this can work? Do you have any ideas of another low cost approach? Thanks
ADO RDD xHarbour
Antonio, Yes, ADORDD may help you, may it has never been tested in a large application so I don't know how it may behave. If you have the time and energy to test it and to complete it then it may be a very good solution for you and for other users too. I am not aware of any other solution except the commercial SQLRDD. Thats why I thought that a free ADORDD could be very usefull and I started its development but had no time to do more <!-- s:-) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":-)" title="Smile" /><!-- s:-) -->