Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Import Access
Message
De
15/06/2006 05:13:40
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01128911
Message ID:
01129214
Vues:
7
hi,

after convert to vfp.dbf, all fileds i dentify as text via access ,see it as memo type at vfp.dbf.
is ther away to change it to character type via the same code .

thanks.
>SQLTABLES() requires to put name of the VFP cursor where you want to recive the result of query. You could name it whatever you want. You could do something like:
>
>lcCrsName = GetFile([DBF])
>SQLTABLES(lcOBDCh,[TABLE],lcCrsName)
>SELECT (lcCrsName)
>....
>
>
>But this will create only a temporary cursor with alias as the real VFP dbf.
>
>>hi,
>>
>>thank you very much,it works.wonderful
>>
>>can i brows only table_name filed to make my choise ,
>>
>>instead SELECT cTableCursor
>>is ther away to get the tables name as getfile('dbf'),to make my choise .
>>
>>thanks again.
>>
>>
>>>Of course:
>>>After you connect to AccessDB (see this line with SQLSTRINGCONNECT()) you could do:
>>>
>>>SQLTABLES(lcOBDCh,[TABLE],[cTableCursor])
>>>SELECT cTableCursor
>>>BROWSE
>>>IF LASTKEY() # 27 && user press ESC
>>>   lcTableName = ALLTRIM(Table_Name)
>>>   SQLEXEC(lcOBDCh,"SELECT * FROM ["+ALLTRIM(Table_Name)+"]",[VFPCursor])
>>>   SELECT VFPCursor
>>>   COPY TO (CHRTRAN(lcTableName,[ ],[_]))
>>>ENDIF
>>>
>>>
>>>This is only an example, no much error checking here
>>>
>>>
>>>>hi,
>>>>thank you so much,it works
>>>>still i'm very week in english languge,
>>>>is there another way to get all tables form my mdb, after that can i choise any table i need to convert via the same code,
>>>>--------------
>>>>after convert can i make ...
>>>>copy VFPCursor to anyname.dbf.
>>>>
>>>>thanks
>>>>
>>>>>The error message is self describing :-)
>>>>>You do a select to a non existing table, change:
>>>>>[SELECT * FROM MyAccessTable]
>>>>>to [SELECT * FROM HERE_PUT_A_NAME_OF_TABLE_THAT_EXISTS_IN_ACCESS_DATABASE]
>>>>>
>>>>>
>>>>>>hi,
>>>>>>ok i chang the user name and password,
>>>>>>
>>>>>>the error message is:
>>>>>>cannot get data from myaccesstable connectivity error:[microsoft][odbc micrososft acsess driver]the microsoft jet database engin cannot find the input table or query[myacess table] make shure it exists and that its name is spelled correctly.
>>>>>>
>>>>>>--------
>>>>>>i fetch *.mdb
>>>>>>via search result
>>>>>>i see as ex...
>>>>>>name infolder
>>>>>>---- --------
>>>>>>order d:\order
>>>>>>121 d:\fadi
>>>>>>.
>>>>>>.
>>>>>>etc....
>>>>>>i open this folders i see the tables inside and data....
>>>>>>thanks.
>>>>>>>What is the error message? Also you didn't change USERNAME PASSWORD to their appropriate values :-)
>>>>>>>
>>>>>>>
>>>>>>>>hi,
>>>>>>>>i try to use your code as under i get error message, what is rong,
>>>>>>>>i have accesss.mdb at drive d:\ as
>>>>>>>>order\order.mdb and d:\fadi\121.mdb....etc
>>>>>>>>
>>>>>>>>lcOBDCh = SQLSTRINGCONNECT([Driver={Microsoft Access Driver (*.mdb)};Dbq=d:\order\order.mdb;Uid=USERNAME;Pwd=PASSWORD;])
>>>>>>>>
>>>>>>>>
>>>>>>>>thanks
>>>>>>>>
>>>>>>>>>>Hi all,
>>>>>>>>>>
>>>>>>>>>>I need to import the contents of an Access table into an existing FoxPro table. What is the best way to do this? I'm new to FoxPro so don't know much about setting up ODBC links - are there any good examples out there?
>>>>>>>>>>
>>>>>>>>>>Thanks
>>>>>>>>>
>>>>>>>>>An example how to connect to Access DB and get data from one of its tables:
>>>>>>>>>
>>>>>>>>>lcOBDCh = SQLSTRINGCONNECT([Driver={Microsoft Access Driver (*.mdb)};Dbq=FULL PATH TO ACCESS DATABASE HERE;Uid=USERNAME;Pwd=PASSWORD;])
>>>>>>>>>IF lcOBDCh < 1
>>>>>>>>>   AERROR(laError)
>>>>>>>>>   MessageBox([Cannot connect to AccessDB ]+laError[1,2])
>>>>>>>>>   RETURN .f.
>>>>>>>>>ENDIF
>>>>>>>>>IF SQLEXEC(lcOBDCh, [SELECT * FROM MyAccessTable],[VFPCursor]) < 1
>>>>>>>>>   AERROR(laError)
>>>>>>>>>   MessageBox([Cannot get data from MyAccessTable ]+laError[1,2])
>>>>>>>>>   SQLDISCONNECT(lcOBDCh)
>>>>>>>>>   RETURN .f.
>>>>>>>>>ENDIF
>>>>>>>>>SELECT VFPCursor
>>>>>>>>>GO TOP
>>>>>>>>>BROWSE NORMAL
>>>>>>>>>
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform