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
> >
> >
> >
> N�HS^�隊X���'���u�����S��+��l��.)��ۭ�����ޱ��y��
��zThm����޲'^�֧t!��:(��!��h�'�-櫝�ޯ+a�x����wZ���j[-�̬��vh���kjب�m���v�,vw(�����x�F���"w~��\�'$Rx��x+��fj)b�
        
b��'��'��.�X���(��~��zw���i����l���q���z���l�X��)ߣ����'��.

Reply via email to