Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Rey Magdalaga
  Where is Rey Magdalaga?
 Rizal Province
 Philippines
 Rey Magdalaga
 To: amro fathi
  Where is amro fathi?
 cairo
 Egypt
 amro fathi
 Tags
Subject: RE: Tableupdate does not work with my table
Thread ID: 104338 Message ID: 104342 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Tuesday, August 15, 2006 9:42:48 AM         
   


> Dear Experts,
>
> mysql table does not saved why?
>
> this is my code:
>
> lnMySQL = SQLSTRINGCONNECT("Driver={MySQL ODBC 3.51 Driver};"+;
> "Server=my_server;"+;
> "Port=3306;"+;
> "Uid=my_id;"+;
> "Pwd=my_pass;"+;
> "Database=my_db;"+;
> "Option=3",.t.)
>
> lcSql = "create table item_tab ("+;
> "code varchar (15) not null default '',"+;
> "name varchar (60) not null default '',"+;
> "balan decimal (15, 3) not null default 0"+;
> ")"
>
> lcSq2 = 'Select * From item_tab'
> lcCursor = 'myCursor'
>
> lnExec = SQLExec(lnMySQL,lcSql)
> lnExec = SQLExec(lnMySQL,lcSq2,lcCursor)
>
> append blank && inseet does not work!
> replace code WITH "150",name WITH "amro",balan WITH "10"
> = TABLEUPDATE(.T.)
>
> my table still empty!
>
> very thanks for all
> Amro


Hi Amro,

When you issue the line :

lnExec = SQLExec(lnMySQL,lcSq2,lcCursor)

it just "Selects" the record or by this time blank record since the table is just created. The cursor myCursor does not make the table updatetable.

You can replace your append blank,replace,tableupdate code lines with this:

lnExec = SQLExec(lnMySQL,[Insert Into item_tab (code,name,balan) Values ('150','amro',10)])


This will insert the record to your MySQL table.

Regards,

ReyM

ENTIRE THREAD

Tableupdate does not work with my table Posted by amro fathi @ 8/15/2006 9:28:25 AM
RE: Tableupdate does not work with my table Posted by Rey Magdalaga @ 8/15/2006 9:42:48 AM
RE: Tableupdate does not work with my table Posted by amro fathi @ 8/15/2006 12:26:12 PM
RE: Tableupdate does not work with my table Posted by Borislav Borissov @ 8/15/2006 10:40:52 AM
RE: Tableupdate does not work with my table Posted by amro fathi @ 8/15/2006 12:27:52 PM