×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

CW-Fieldtypes equvalent to MySQL

CW-Fieldtypes equvalent to MySQL

CW-Fieldtypes equvalent to MySQL

(OP)
Hallo all,

I am able to access to a MySQL-DB on a Linux-Webserver.

I want to write a small program in CW 5.5e ´to work on the Web-DB from my Desktop.

Where can I get info about the different fieldtypes?

What is char or varchar, int, date etc equivalent to in CW?

Is there any source where I can look at?

tia
bazzo

RE: CW-Fieldtypes equvalent to MySQL

(OP)
Gaudalier,

thank you very much for your helpful reply.

One additionale question: Rick Hoffmann writes about MS-SQL.

Is there a difference or any difference at all between the different SQL-breeds concerning the fieldtypes?

bye
bazzo

RE: CW-Fieldtypes equvalent to MySQL

(OP)
Gaudalier,

sorry but I have to come up with another question.

Each MySQL has a user and a password.

My first SQL-DB is "myfirstsql" and it contains one table, simply "adresses"

As far as I understood the resources you mentioned I need to put them into the dictionary.

Name: "adresses"
Driver: "ODBC"
DriverOptions: ""
OwnerName: "myfirstsql,username,userpassword"
Fullpathname: ""

Is that correct?

At the moment I test it locally on my computer.

Apache, MySQL and phpMyAdmin run successful.

Accessing does not work, I receive a message
"File adresses could not be opened, Access denied for user username@...."

Then I realized that I have no user and no pw locally.

I tried root instead of username, without pw.

Result is now "[mysql][odbc3.51]unknown database 'adresses'"

What is my mistake?
tia
bazzo

RE: CW-Fieldtypes equvalent to MySQL

IF ya're using ODBC Try putting on the Table's Owner Name:




<YourSQLServer>,<user>,<password>;




I'm using Direct Access to MSSQL 7.0 (NO ODBC) & I'm using a Single Global Variable for All the Tables' Owner Name, and that variables is initialized before open any table this way:


Glo:Login = 'MyServerName,MyDataBase,UserName,Password,'



So you must to do it in testing with MySql (wich I'll be using very soon!.)

bye

-----
carabez@hotmail.com

RE: CW-Fieldtypes equvalent to MySQL


Sorry, I forgot to mention that you MUST to append ';' at ODBC OWNER name:

<YourSQLServer>,<user>,<password>;

And I typed an aditional ',' at:

Glo:Login = 'MyServerName,MyDataBase,UserName,Password'


Q.- Is there a difference or any difference at all between the different SQL-breeds concerning the fieldtypes?


R.- Hope it ain't differeces at all but I'm usign LONG for store DATES, so I Still usign the PICTURE  @d8 or any that normally is used in TPS files...

Regards!.

-----
carabez@hotmail.com

RE: CW-Fieldtypes equvalent to MySQL

(OP)
Hello again, Gaudalier,

after your tips I kept on trying......

That ; is significant to terminate the owner, indeed!

Clarion is such a great product, but has a poor manual.

After this hint I indeed got one step further and connected to the datbase - just to receive an "Error: Invalid Record Declaration (47)"

Ok, I thought, maybe I wanted too much at once with my char, varchar, int and time...

SO I created another test with a complete new DCT and APP.

I encountered another problem: Table-names may not be longer than 8 character <sigh> [more than poor documentation]{or I have simply overread}

The new dict contained one int(11)/long(???) and three char(20)/string(20).

The field "id" in the SQL-table is autonumbered and primary and unique as it is in Clarion

Same result: 47......

pooooh....... but in general it is easy to use SQL in Clarion, isn't it?

slightly frustated
bazzo

RE: CW-Fieldtypes equvalent to MySQL

Hola!...

Ok, to overide the 47 error, Clarion's table definition (on the dic) and the SQL Tables MUST MATCH in Size!...

Ergo, if ya wanna implement:

CLARION:
Field       Type      Size
Id          LONG      4  bytes
String1     STRING    20 bytes
String2     STRING    20 bytes
String3     STRING    20 bytes
                   64 bytes

SQL:
Id          Int      4  bytes
String1     Char    20 bytes
String2     Char    20 bytes
String3     Char    20 bytes
                 64 bytes

After that, You'll need to Implement the keys, As you know the if the keys Don't match, we'll get the 47 Horror...

SQL:
IndexName    FieldName   Attr.
PK_ID        Id          Primary, Unique

Clarion:
Key_Name   External_Name  Attr.
PK_ID      PK_ID          Unique,Primary, CaseSensitive,Row


The AutoNumber will be manage by The SQL Engine (Only in these tables that has SingleField Primary Keys).


It's Important to note, that if there are any changes in the Database layout, must to be done first on MySQl, and reflect the changes to the Clarion's Dic.

The Calrion's  Key Name and External Name MUST BE like the SQL Index Name!


That all!.


bye.

-----
carabez@hotmail.com

RE: CW-Fieldtypes equvalent to MySQL

(OP)
Hi again, Gaudalier.

You say "that be all" - and I bet you are able to do the right things.... but I still stumble across (maybe) stupid questions:

How long is a LONG? >> CW Manual: " LONG  - A four-byte signed integer."

> CLARION:
> Field       Type      Size
> Id          LONG      4  bytes
 
assuming this 4 bytes are the usual size of a Clarion LONG I adjusted my id in MySQL to int(4).

btw id is the only field now in that table to avoid any interference from mistakes caused by strings or other buddies

But you can already guess...even that simple table does return an Invalid Record Error (47)

> After that, You'll need to Implement the
> keys, As you know the if the keys Don't
> match, we'll get the 47 Horror...

> SQL:
> IndexName    FieldName   Attr.
> PK_ID        Id          Primary, Unique

oh well, what is the index's name?

I tried the filename test3 (because it is test3.MYI),
I tried PRIMARY,
I tried id

 - none of it worked

> The Calrion's  Key Name and External Name MUST BE
> like the SQL Index Name!

but how?

meanwhile I get a connection to the database (don't ask me why and how)

I have found out that I have to write
the Full Pathname c:\mysql\data\mytest\test3.myd
(How will this ever work on the web?)

Now I have a connection

I know that because I receive another error-message now:
"An error occured in your SQL-syntax near WHERE 0=1 in Line 1"



-----

> Clarion:
> Key_Name   External_Name  Attr.
> PK_ID      PK_ID          Unique,Primary, CaseSensitive,Row


> The AutoNumber will be manage by The SQL Engine
> (Only in these tables that has SingleField Primary Keys).

In CWs key AutoNumber has no to be marked?




(... and what happens if the given MySQL-table has an INT which is not 4-byte?)



soooo many questions...

I have spent days now to get that running, it is rather disappointing.

Good night for now
bazzo

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close