Look at the examples in the Unicon Programming book on the unicon.sf.net 
site. open() takes 5 values and you aren't including a userid or password 
in the example you give.

Phillip Thomas


 On Sat, 3 Apr 2004, Lu Song wrote:

> 
> I  made some experiment about this problem and found that
> 
> Unicon can  NOT open odbc database when
> --------------------------------------------
> str := "hello\n"||center("database")
> db := open("myodbc3-test", "o", "root", "")
> --------------------------------------------
> If to add login() before open(...), it can make it.
> 
> 
> But Unicon work well when
> --------------------------------------------------
> str := "hello"
> db := open("myodbc3-test", "o", "root", "")
> --------------------------------------------------
> or
> --------------------------------------------
> db := open("myodbc3-test", "o", "root", "")
> str := "hello\n"||center("database")
> --------------------------------------------
> 
> So I thought maybe the problem is on "center" function.  But I don't the reason to 
> it.
> 
> And I found another problem in ODBC interface 
>   
> In the paper "An ODBC Interface for the Unicon Programming Language ", in the demo 
> code,
> ----------------------------------
> procedure insertphone()
>   writes("name: ")
>   name := read()
>   writes("phone: ")
>   ph := read()
>   writes("address: ")
>   addr := read()
>   sql(db, "INSERT INTO phones VALUES(" ||
>            name || "," || ph || "," || addr || ")")
>   if &errornumber~= 0 then
>     write("*** couldn't insert person ***")
> end
> ----------------------------------
> 
> the function "insertphone()", I could insert one record successfully, 
>  but the demo code always return the message :
> "*** couldn't insert person ***" , 
>  I found "&errornumber" = 1114.  
>   
>  What is the reason?
>   
>  Song
> 
> 
>  
> 
> ----- Original Message ----- 
> From: "Federico Balbi" <[EMAIL PROTECTED]>
> To: "Lu Song" <[EMAIL PROTECTED]>
> Sent: Friday, April 02, 2004 11:30 PM
> Subject: Re: [Unicon-group] about odbc
> 
> 
> > Are you sure there is not another open() that uses those variables read in
> > login() ? What is your platform? Did you set up the ODBC manager? If you
> > just use the open() you mentioned then login() should not affect it.
> > 
> > Federico
> > 
> > 
> > 
> > "With great powers come great responsibilities" - Spiderman
> > 
> > Federico Balbi
> > Division of Computer Science
> > University of Texas at San Antonio
> > 6900 N. Loop 1604 West
> > San Antonio, TX 78249-0667
> > 
> > [EMAIL PROTECTED]
> > http://www.cs.utsa.edu/~fbalbi
> > 
> > On Wed, 31 Mar 2004, Lu Song wrote:
> > 
> > >
> > > I tried to connect mySQL at localhost following the paper "An ODBC Interface for 
> > > the Unicon Programming Language " and found some strange problems.
> > >
> > > I can't open the db with
> > > ----------------------------------------
> > > db:= open("myodbc3-test","o","root","")
> > > ----------------------------------------
> > >
> > > But if I can open the db successfully with
> > > ----------------------------------------
> > > login()
> > > db := open("myodbc3-test","o","root","")
> > > ----------------------------------------
> > >
> > > as login() is
> > > -----------------------
> > > procedure login()
> > >   writes("user: ")
> > >   user := read()
> > >   writes("password: ")
> > >   password := read()
> > > end
> > > -----------------------
> > >
> > > Someone could tell me the reason?
> > >
> > >
> > > Song
> > >
> > >
> > >
> > �����������������������������������������ӆ+�^�隊X���'���u�� 
> > �{�N�h�&��Z�x���n���jZkzǧ��[�6���Q����ϭ�"u��jwB��Ӣ�^r薈"z��y��z����b��g�֦z{Z��h�+-zf��)��ڶ*'�m���i����g��&����'׎���e�������������������������������������������'��'�躙��X��X��I�r����.��b������q�����a��l����l��.�ǟ���w��X�����b��?�x��஋�
> 



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to