f



RDDSQL - where to find an example

Hi guys!
I wanna find example about using RDDSQL and MySQL database via ODBC
driver, _not_ via mysqll.dll
I've tried to modify samples\rdd.sql\odbc\demo.prg but get an error
while retrieving data from sql table.

Many thanks for help.
Best regards, Marek
0
mol (4)
11/16/2009 4:08:15 PM
comp.lang.xharbour 5470 articles. 0 followers. Post Follow

3 Replies
3044 Views

Similar Articles

[PageSpeed] 36

Marek

> Hi guys!
> I wanna find example about using RDDSQL and MySQL database via ODBC
> driver, _not_ via mysqll.dll
> I've tried to modify samples\rdd.sql\odbc\demo.prg but get an error
> while retrieving data from sql table.
why you want odbc insted of native connection

to use odbc do
open control panel/  Administrative tools/data source
click on add and follow the strings

then on sqlrdd.ini add
[MYSQLODBC]
ConnString=DSN=dnscreated

Regards
Luiz
0
culikr
11/16/2009 4:48:06 PM
On 16 Lis, 17:48, "cul...@gmail.com" <cul...@gmail.com> wrote:
> Marek
>
> > Hi guys!
> > I wanna find example about using RDDSQL and MySQL database via ODBC
> > driver, _not_ via mysqll.dll
> > I've tried to modify samples\rdd.sql\odbc\demo.prg but get an error
> > while retrieving data from sql table.
>
> why you want odbc insted of native connection
>
> to use odbc do
> open control panel/ =A0Administrative tools/data source
> click on add and follow the strings
>
> then on sqlrdd.ini add
> [MYSQLODBC]
> ConnString=3DDSN=3Ddnscreated
>
> Regards
> Luiz

I'm able to connect to database. As I've tested, the problem lays in
in datatypes. When I create table with fields of char type, program
crashes with error.
When I use only int fields, everything goes OK.
I put a little working sample below:

* RDD SQL DEMO
* Based on Harbour Compiler Contrib Samples
* Adapted for HMG by Roberto Lopez - 2009

* Modified 2009.11.17 by Marek Olszewski for testing Record Locking
with MySQL/ODBC

//#include "minigui.ch"
//#include "dbinfo.ch"
#include "error.ch"

#define DBI_QUERY             1001

#define RDDI_CONNECT          1001
#define RDDI_DISCONNECT       1002
#define RDDI_EXECUTE          1003
#define RDDI_ERROR            1004
#define RDDI_ERRORNO          1005
#define RDDI_NEWID            1006
#define RDDI_AFFECTEDROWS     1007
#define RDDI_QUERY            1008


REQUEST SQLMIX, SDDODBC

PROC main()

	RDDSETDEFAULT( "SQLMIX" )

	SET( 4, "yyyy-mm-dd" )
	//ODP :=3D RDDINFO( RDDI_CONNECT, { "ODBC", "DBQ=3D"  + "test.mdb;Driver=
=3D
{Microsoft Access Driver (*.mdb)}" } )

	odp :=3D RDDINFO( RDDI_CONNECT,;
		{ "ODBC", "DBQ=3D" +"Server=3Dlocalhost;Driver=3D{MySQL ODBC 5.1
Driver};dsn=3D;User=3Droot;password=3D123;database=3Dtest;Option=3D35;" } )

	if odp =3D 0
		MsgBox("No connect to server... Answer is: " + xtoc(Odp))
		return
	endif

	// it's required to use record locking to set autocommit to 0!!!!
	? "set autocommit", RDDINFO(RDDI_EXECUTE,"SET AUTOCOMMIT =3D 0")
	? "drop table", RDDINFO(RDDI_EXECUTE, "DROP TABLE country")

	// create table with character fields
	//? "create table", RDDINFO(RDDI_EXECUTE, "CREATE TABLE country (CODE
char(3), NAME char(50), RESIDENTS int(11))")

	// create only numeric fields
	? "create table", RDDINFO(RDDI_EXECUTE, "CREATE TABLE country
(RESIDENTS int(11))")

	// data for inserting when table has character fields
	//cDane :=3D charrem(":","INSERT INTO country values ('AAA','TS" +dtos
(date())+time()+"',"+time()+")")

	// data for only numeric fields
	cDane :=3D charrem(":","INSERT INTO country values (" +time()+")")

	? "insert", cdane, RDDINFO(RDDI_EXECUTE, cDane )
    ? "commit", RDDINFO(RDDI_EXECUTE, "COMMIT")
	? "use...", DBUSEAREA( .T.,, "SELECT * FROM test.country",
"country" )
	? "Alias:", ALIAS()
	? "DB struct:", HB_VALTOEXP( DBSTRUCT() )
	INKEY( 0 )
	BROWSE()
	DBCLOSEAREA()
RETURN
1
MOL
11/17/2009 10:13:54 AM
Mol

use an real sqlrdd driver

try sqlrdd from xharbour.com

you can donwload the demo from www.xharbour.com, or you can get the
http://free.xharbour.com which some with an demo version for bcc

Regards
Luiz

On 17 nov, 08:13, MOL <m...@pro.onet.pl> wrote:
> On 16 Lis, 17:48, "cul...@gmail.com" <cul...@gmail.com> wrote:
>
>
>
> > Marek
>
> > > Hi guys!
> > > I wanna find example about using RDDSQL and MySQL database via ODBC
> > > driver, _not_ via mysqll.dll
> > > I've tried to modify samples\rdd.sql\odbc\demo.prg but get an error
> > > while retrieving data from sql table.
>
> > why you want odbc insted of native connection
>
> > to use odbc do
> > open control panel/ =A0Administrative tools/data source
> > click on add and follow the strings
>
> > then on sqlrdd.ini add
> > [MYSQLODBC]
> > ConnString=3DDSN=3Ddnscreated
>
> > Regards
> > Luiz
>
> I'm able to connect to database. As I've tested, the problem lays in
> in datatypes. When I create table with fields of char type, program
> crashes with error.
> When I use only int fields, everything goes OK.
> I put a little working sample below:
>
> * RDD SQL DEMO
> * Based on Harbour Compiler Contrib Samples
> * Adapted for HMG by Roberto Lopez - 2009
>
> * Modified 2009.11.17 by Marek Olszewski for testing Record Locking
> with MySQL/ODBC
>
> //#include "minigui.ch"
> //#include "dbinfo.ch"
> #include "error.ch"
>
> #define DBI_QUERY =A0 =A0 =A0 =A0 =A0 =A0 1001
>
> #define RDDI_CONNECT =A0 =A0 =A0 =A0 =A01001
> #define RDDI_DISCONNECT =A0 =A0 =A0 1002
> #define RDDI_EXECUTE =A0 =A0 =A0 =A0 =A01003
> #define RDDI_ERROR =A0 =A0 =A0 =A0 =A0 =A01004
> #define RDDI_ERRORNO =A0 =A0 =A0 =A0 =A01005
> #define RDDI_NEWID =A0 =A0 =A0 =A0 =A0 =A01006
> #define RDDI_AFFECTEDROWS =A0 =A0 1007
> #define RDDI_QUERY =A0 =A0 =A0 =A0 =A0 =A01008
>
> REQUEST SQLMIX, SDDODBC
>
> PROC main()
>
> =A0 =A0 =A0 =A0 RDDSETDEFAULT( "SQLMIX" )
>
> =A0 =A0 =A0 =A0 SET( 4, "yyyy-mm-dd" )
> =A0 =A0 =A0 =A0 //ODP :=3D RDDINFO( RDDI_CONNECT, { "ODBC", "DBQ=3D" =A0+=
 "test.mdb;Driver=3D
> {Microsoft Access Driver (*.mdb)}" } )
>
> =A0 =A0 =A0 =A0 odp :=3D RDDINFO( RDDI_CONNECT,;
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { "ODBC", "DBQ=3D" +"Server=3Dlocalhost;D=
river=3D{MySQL ODBC 5.1
> Driver};dsn=3D;User=3Droot;password=3D123;database=3Dtest;Option=3D35;" }=
 )
>
> =A0 =A0 =A0 =A0 if odp =3D 0
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 MsgBox("No connect to server... Answer is=
: " + xtoc(Odp))
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 return
> =A0 =A0 =A0 =A0 endif
>
> =A0 =A0 =A0 =A0 // it's required to use record locking to set autocommit =
to 0!!!!
> =A0 =A0 =A0 =A0 ? "set autocommit", RDDINFO(RDDI_EXECUTE,"SET AUTOCOMMIT =
=3D 0")
> =A0 =A0 =A0 =A0 ? "drop table", RDDINFO(RDDI_EXECUTE, "DROP TABLE country=
")
>
> =A0 =A0 =A0 =A0 // create table with character fields
> =A0 =A0 =A0 =A0 //? "create table", RDDINFO(RDDI_EXECUTE, "CREATE TABLE c=
ountry (CODE
> char(3), NAME char(50), RESIDENTS int(11))")
>
> =A0 =A0 =A0 =A0 // create only numeric fields
> =A0 =A0 =A0 =A0 ? "create table", RDDINFO(RDDI_EXECUTE, "CREATE TABLE cou=
ntry
> (RESIDENTS int(11))")
>
> =A0 =A0 =A0 =A0 // data for inserting when table has character fields
> =A0 =A0 =A0 =A0 //cDane :=3D charrem(":","INSERT INTO country values ('AA=
A','TS" +dtos
> (date())+time()+"',"+time()+")")
>
> =A0 =A0 =A0 =A0 // data for only numeric fields
> =A0 =A0 =A0 =A0 cDane :=3D charrem(":","INSERT INTO country values (" +ti=
me()+")")
>
> =A0 =A0 =A0 =A0 ? "insert", cdane, RDDINFO(RDDI_EXECUTE, cDane )
> =A0 =A0 ? "commit", RDDINFO(RDDI_EXECUTE, "COMMIT")
> =A0 =A0 =A0 =A0 ? "use...", DBUSEAREA( .T.,, "SELECT * FROM test.country"=
,
> "country" )
> =A0 =A0 =A0 =A0 ? "Alias:", ALIAS()
> =A0 =A0 =A0 =A0 ? "DB struct:", HB_VALTOEXP( DBSTRUCT() )
> =A0 =A0 =A0 =A0 INKEY( 0 )
> =A0 =A0 =A0 =A0 BROWSE()
> =A0 =A0 =A0 =A0 DBCLOSEAREA()
> RETURN

0
culikr
11/17/2009 1:00:08 PM
Reply:

Similar Artilces:

mc finds more than `find` finds?
I'm still searching for a way to know the pid of eg. the instance of `wily` which is has a certain file open. `pgrep wily` lists all the instances of 'wily' I was hoping that, I'd find which wily has opened file *CONTROL* by:- for PID in `pgrep wily`; do find /proc/$PID -exec grep -l "CONTROL" {} \; >> trace; done --- that's supposed to be ONE line --- Using successive refinement: first I used mc to browse /proc/24357 to find a suitable search target. Obviously "wily" would be there. Then I 'confirmed ?': find /proc/24...

find.find
import fnmatch, os def find(pattern, startdir=os.curdir): matches = [] os.path.walk(startdir, findvisitor, (matches, pattern)) matches.sort() return matches def findvisitor((matches, pattern), thisdir, nameshere): # for name in nameshere: if fnmatch.fnmatch(name, pattern): fullpath = os.path.join(thisdir, name) matches.append(fullpath) can someone explain why (matches, pattern) is doing in this two funct? thanks In <eo15uq$hna$1@ss408.t-com.hr>, Gigs_ wrote: > import fnmatch, os > > def find(pattern, startdir=os...

Finding an example
I'm hoping someone here familiar with some of the example sites can direct me to a good example of the following behavior(s): If I have a couple of textfields, and a single listbox, wherein I can select a text field(perhaps, having it be denoted somehow as selected, similar to, say, what hotmail shows for the various address fields ehen composing a message) and then select a value in the listbox, which would be inserted at the caret position in the selected textbox. There most likely is an example of this somewhere -- is anyone aware of where I might find such an example? Thank you...

Find::Find
I'm writing a script to process a directory tree of images.  In each directory, I need to process each image and generate an HTML file listing all of the images and links to the subdirectories. Just about every source I can find on the 'net for processing subdirectories points you at Find::Find.  However, I'm trying to do something like this: enter directory open INDEX, ".\index.html" print INDEX HTMLheader foreach file{         if(file is an image){  ...

Find.find does not find orphaned links?
Find.find does not seem to find orphaned links: Downloads>ln -s /nonexistent Downloads>ls -l total 0 lrwxrwxrwx 1 wybo users 12 Nov 15 14:15 nonexistent -> /nonexistent Downloads>irb irb(main):001:0> require 'find' => true irb(main):002:0> Find.find('.') do |f| puts f end Hi, In message "Re: Find.find does not find orphaned links?" on Tue, 15 Nov 2005 22:19:59 +0900, Wybo Dekker <wybo@servalys.nl> writes: |Find.find does not seem to find orphaned links: It's a bug. Thank you. matz. ...

Where find an blackboard example?
I'd like to know how to write a blackboard. There is a simple example on the web? where can I find it? Thankyou in advance to all. Mario. _mario lat wrote: > I'd like to know how to write a blackboard. > There is a simple example on the web? > where can I find it? > Thankyou in advance to all. > Mario. Step 1: make up your mind whether you want a ready-made one or to write one yourself. Step 2: get a clear idea of what you want your "blackboard" to do Step 3: have a go at translating your idea into program logic, and coding it up. If you get stuck, p...

Pushlet.. Where to find examples?
Hi, I am tasked with implementing a pushlet for our app to accept listening clients etc.. Is there anywhere I can find some decent examples? I think I have the jist of it but would like to see how others have done it! Cheers guys.. Steve ...

where to find corba examples
Hi, I found that it is hard to some some corba examples for learners. Can anybody tell me where to find some corba examples written in C++ ? thanks in advance. Jesse jessecwzy@eyou.com (Jesse) wrote in message news:<13acbf70.0310170518.289f6438@posting.google.com>... > Hi, > > I found that it is hard to some some corba examples for learners. Can > anybody tell me where to find some corba examples written in C++ ? Several CORBA vendors allow manuals to be downloaded (typically as PDF files) from their web sites. You could download a product manual and ...

When Find finds something -
- it sometimes highlights the thing and sometimes puts a little dotted box around it. What's the difference? It's very hard to see the dotted box sometimes and I have to Find it visually! Is there a way to change this "found" indicator to make it more conspicuous? Thank you in advance. Steve Gray On Apr 23, 2:12 am, Steve Gray <stev...@roadrunner.com> wrote: > - it sometimes highlights the thing and sometimes puts a > little dotted box around it. What's the difference? It's very hard to > see the dotted box sometimes and I have t...

Find.find bug?
$ ruby -rfind -e 'Find.find("foo") {|e| p e}' "foo" $ ls foo C:\msys\1.0\local\bin\ls.exe: foo: No such file or directory It should return nothing if foo doesn't exist. martin Hi, At Wed, 8 Sep 2004 00:45:09 +0900, Martin DeMello wrote in [ruby-talk:111751]: > > $ ruby -rfind -e 'Find.find("foo") {|e| p e}' > "foo" > > $ ls foo > C:\msys\1.0\local\bin\ls.exe: foo: No such file or directory > > It should return nothing if foo doesn't exist. What version ruby do you run? $ LANG=C ls foo ls: foo:...

FIND finds too much
% The problem, easily seen below, is the unexpected behavoir of FIND. % DTA is an 1152x17 matrix whose details should not, it seems to me, be important. A1=find(DTA(:,2)==+1&DTA(:,3)==-1); DTA(A1(1:2),2:3),DTA(A1(end-1:end),2:3) ans = 1 -1 1 -1 ans = 1 -1 1 -1 % So far so good, only 1 -1 combinations present (directly verified for ALL entries, % in DTA(A1,:), not just those shown here). But then A2=find(DTA(A1,4)==DTA(A1,5)); DTA(A2(1:2),2:3),DTA(A2(end-1:end),2:3); ans = 1 -1 1 -1 ans = 1 1 1 1 % Why...

finding find.c
comp.os.minix finding find.c Anyone know where the source for find is. I've been looking on 2.0.2 and haven't been able to find it. Hul I found it. Find, for some reason, can't find itself unless its given an explicit name. Hul Hul Tytus <ht@panix.com> wrote: > comp.os.minix > finding find.c > Anyone know where the source for find is. I've been looking on 2.0.2 and > haven't been able to find it. > Hul ...

help on find over find
hi all I have a problem trying to do the following: MyModel.find(:all).find(:first) it can look weird or unnecesary but this is the short explanation, extended one is: I have a helper method, this receives a collection an return some html, this helper works fine if that collection is an association (has_many) of a model but doesn't work if it is a direct find over a model the error I receive is "LocalJumpError: no block given" ultra mega extended explanation is: a model: class User < ActiveRecord::Base has_many :requests end other model: cla...

Where can I find SNMP4J examples?
Hi, Where can I find basic SNMP4j examples like a simple program that does a GET, GETNEXT request and prints the output (in all SNMP versions), or a simple tool that does a MIB Walk? Thanks, Gil Hi Gil, as already answered on the SNMP4J mailing list: You can find a simple example for a GETNEXT request (for the corresponding GET replace GETNEXT with GET in the code) can be found in the JavaDoc of the Snmp class: http://www.snmp4j.org/doc/org/snmp4j/Snmp.html For a complete _example_ of the various SNMP4J features you can browse the org.snmp4j.tools.console.SnmpRequest c...

Web resources about - RDDSQL - where to find an example - comp.lang.xharbour

File:An example of theoretical DNS recursion.svg - Wikipedia, the free encyclopedia
A DNS resolver iteratively queries a root nameserver, org. nameserver, and wikipedia.org. nameserver in its quest to resolve the IP address associated ...

7 Examples Of Legal Facebook Cover Photos
... to do this experiment.) We thought it’d also be helpful to highlight what other social media experts and brands are doing. Here are a few examples ...

Taking a Deeper Look at Application Traffic Over the Last 30 Days: 6 Examples
Although there has been a lot of speculation in the last few weeks, the long term impacts of the profile redesign on the Facebook platform have ...

example (@example) on Twitter
Sign in Sign up To bring you Twitter, we and our partners use cookies on our and other websites. Cookies help personalize Twitter content, tailor ...

silk and spinach - development, by example
development, by example (by Kevin Rutherford)

What are some good examples of landing pages for physical products?
There are some updates to this page that haven't been applied yet because you've entered some data into a form. You can refresh this page to ...

Words With Friends example
scripting.com/stories/2011/01/10/wordsWithFriends.html

Raw vs JPEG: Real-world photography examples, advantages and disadvantages - YouTube
For more, like http://fb.com/NorthrupPhotography and SUBSCRIBE! Buy my #1 book with 6 HOURS of video: http://amzn.to/1dCRJWA Worldwide use 10% ...

Captive-Network Example
Visit the post for more.

Turkey setting ‘poor example’ for freedom of expression: Biden
Turkey setting ‘poor example’ for freedom of expression: Biden

Resources last updated: 1/24/2016 10:41:43 AM