Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

linking an access database with a visual foxpro database by dde

Status
Not open for further replies.

pomawo

Programmer
Jun 2, 2000
7
NL
Hello,<br><br>I am a 25 year old dutch student who earns money for his study by developping databases.<br><br>Two years ago i have made an invoice system in Ms Acess.<br>Now i am already finisched with developping an sales relations system in Visual Fox Pro. But I have some problems with dde.<br><br>What i want is to insert an record from a cursor into a access table. I already have this code, that works fine but when i whant to write a insert-sql-query it goes wrong.<br>Another problem is that i cannot pass the value of ln-klantid to place where now &quot;ABLOB3&quot; stands.<br><br>here is my source code<br><br>ln_klantid = thisform.relatie.value<br>mchannum = DDEInitiate('Msaccess', 'system')<br>IF mchannum != -1<br>glExecute = DDEExecute(mChanNum, &quot;[opendatabase c:\eck\database\artline.mdb]&quot;)<br><br>DDEExecute(mChanNum, &quot;[Opentable 'klanten']&quot;)<br>DDEExecute(mChanNum, &quot;[selectobject actable, 'klanten']&quot;)<br>DDEExecute(mchannum, &quot;[ApplyFilter , klantid = 'ABLOB3']&quot;)<br>DDEExecute(mChanNum, &quot;[selectobject actable, 'klanten']&quot;)<br>DDEExecute(mchannum, &quot;[insert into klanten (achternaam)values (test1)]&quot;) ***** here is the mistake<br><br>Can someone help me, thanks in advance<br><br>Sorry for my poor englisch<br>
 
Pomawo, if you have a fairly modern version of Access I would suggest doing this via ODBC instead of DDE.&nbsp;&nbsp;It is much easier and straightforward to code.&nbsp;&nbsp;Your program would be written this way similar to this:<br><br><FONT FACE=monospace>ln_klantid = thisform.relatie.value<br>lnHandle = sqlconnect('MyDSNforArtline')<br>sqlexec(lnHandle, &quot;select * from klanten where klantid=&quot;+ln_klantid)<br><font color=red>not sure why you'd want the above statement</font><br>sqlexec(lnHandle, &quot;insert into klanten (achternaam) values (test1)&quot;)<br></font><br><br> <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
If you are using the latest VFP6 and ODBC, you do not have to use the SQLEXEC statements.&nbsp;&nbsp;You can define an ODBC connection (view) in you project and use standard FoxPro commands (SKIP, SCAN..ENDSCAN, etc.) in you programs. <p>Mike Wood<br><a href=mailto:mwood@awod.com>mwood@awod.com</a><br><a href= > </a><br>
 
You can define remote views starting in VFP 3.&nbsp;&nbsp;As Mike said, remote views can make working with remote data just like working with native Fox tables.&nbsp;&nbsp;You'll need to store the view and connection definitions in a DBC. <p>Robert Bradley<br><a href=mailto: > </a><br><a href= - Visual FoxPro Development</a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top