Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yuri Rubinov
  Where is Yuri Rubinov?
 Philadelphia
 Pennsylvania - United States
 Yuri Rubinov
 To: Jo Vandendriessche
  Where is Jo Vandendriessche?
 Vosselare
 Belgium
 Jo Vandendriessche
 Tags
Subject: RE: ODBC connection destroys Excel2000 file
Thread ID: 34093 Message ID: 34355 # Views: 1 # Ratings: 0
Version: Visual FoxPro 8 Category: ODBC, ADO and OLEDB
Date: Friday, December 12, 2003 2:49:07 PM         
   


Sorry, no other ideas for now. Please inform us if you find solution or the cause of this behavior.


> With your code and the new dsn file and with sql pass-through, still the same problem! Any more idea's?
>
> CREATE CONNECTION MyConn CONNSTRING ;
> "Provider=MSDASQL.1;" + ;
> "Persist Security Info=False;" + ;
> "Extended Properties=" + ;
> '"DSN=Excel-Bestanden;DBQ=' + ;
> bronbestand + ';DefaultDir=C:;DriverId=790;FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\jvd.dsn;MaxBufferSize=2048;PageTimeout=5;"'
>
> * sql pass-through
> nConnectionHandle = SQLCONNECT("MyConn")
> ? SQLEXEC(nConnectionHandle,"select * from Leden$","leden")
> USE "leden"
> BROWSE
>
>
>
> > Not sure, but perhaps this will help:
> >
> > CREATE CONNECTION MyConn CONNSTRING;
> > [Provider=MSDASQL.1;]+;
> > [Persist Security Info=False;]+;
> > [Extended Properties=]+;
> > ["DSN=Excel Files;DBQ=]+;
> > bronbestand+[;DefaultDir=C:;DriverId=790;]+;
> > [FILEDSN=C:\Program Files\Common Files\ODBC\Data Sources\Excel Files (not sharable).dsn;MaxBufferSize=2048;PageTimeout=5;"]
> >
> > Connection string details may vary, create a New Microsoft Data Link file as usual to get the connection string
> >
> >
> > > I did try this, but sadly enough this is not the solution, same problem.
> > >
> > >
> > > > Try to change the view name. I suspect that view should not have the very same name as a source.
> > > >
> > > >
> > > > > I create an ODBC connection to a Excel2000 file that contains the
> > > > > worksheet 'Leden'.
> > > > >
> > > > > The sourcecode:
> > > > >
> > > > > * Create connection
> > > > > bronbestand = ...
> > > > > connstr = ;
> > > > > "DSN=Excel-bestanden;" + ;
> > > > > "DBQ=" + bronbestand + ";" + ;
> > > > > "DefaultDir=" + JUSTPATH(bronbestand) + ";" + ;
> > > > > "DriverId=790;" + ;
> > > > > "MaxBufferSize=2048;" + ;
> > > > > "PageTimeout=5;"
> > > > > "Extended Properties=Excel 2000;"
> > > > > CREATE CONNECTION MyConn CONNSTRING connstr
> > > > > * Create view
> > > > > CREATE SQL VIEW Leden REMOTE CONNECTION MyConn AS SELECT * FROM $leden
> > > > > DBSETPROP("Leden","VIEW","SendUpdates",.T.)
> > > > > DBSETPROP("Leden.nr","FIELD","KeyField",.T.) && unique number
> > > > > DBSETPROP("Leden.nr","FIELD","Updatable",.F.)
> > > > > *
> > > > > USE "Leden"
> > > > >
> > > > >
> > > > > If I change a record in the table 'Leden' (programmatically or through a
> > > > > browse window), I don't get error messages. But when I close the view and
> > > > > try to open it again with USE
> > > > >
> > > > > When I try to open the view again with I get an ODBC error message:
> > > > > The external table has an unexpected format. (did translate this form dutch!)
> > > > > When I try to open the Excel file in Excel again, I get an application error!!!:
> > > > > The instruction on 0x3004c518 .....
> > > > > THE EXCEL FILE IS CORRUPT!
> > > > >
> > > > > I run on a XP PC but I have the same problem on a Windows98SE PC.
> > > > > With an Access database everything works fine.
> > > > > I have exactly the same problem weh I create the connection and the view
> > > > > through the database user interface!
> > > > > I have the same problem in FOXPRO 6 and FOXPRO 8!
> > > > > IF I SAVE THE EXCEL SHEET AS A EXCEL97 VERSION I DON'T HAVE THE PROBLEM,
> > > > > EVERTHING WORKS JUST FINE WITH EXACTLY THE SAME CODE! But almost all my
> > > > > customers use Excel2000.
> > > > >
> > > > > Can anyone help me.
> > > > >
> > > > > Thanks


ENTIRE THREAD

ODBC connection destroys Excel2000 file Posted by Jo Vandendriessche @ 12/8/2003 10:23:11 PM
RE: ODBC connection destroys Excel2000 file Posted by Yuri Rubinov @ 12/9/2003 4:04:44 PM
RE: ODBC connection destroys Excel2000 file Posted by Jo Vandendriessche @ 12/10/2003 9:38:07 AM
RE: ODBC connection destroys Excel2000 file Posted by Yuri Rubinov @ 12/10/2003 2:47:52 PM
RE: ODBC connection destroys Excel2000 file Posted by Yuri Rubinov @ 12/10/2003 4:02:59 PM
RE: ODBC connection destroys Excel2000 file Posted by Jo Vandendriessche @ 12/10/2003 10:44:44 PM
RE: ODBC connection destroys Excel2000 file Posted by Yuri Rubinov @ 12/12/2003 2:49:07 PM