(a) Don't use an explicit recordset object that way,
(b) See
http://www.aspfaq.com/2188
--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Matt Young" <stewartfip@yahoo.com> wrote in message
news:3830b9b0.0401240741.211bf96a@posting.google.c om...[color=blue]
> I've been tasked with integrating an older management system based on
> DBF files with my snappy new ASP application to provide users of the
> ASP application with real-time data from the management system.
>
> I figure with DBF files, I should use either the DBase drivers or the
> FoxPro drivers to connect to the database.
>
> The integration has gone quite smoothly until yesterday. This means
> that my connection strings work well based on the DBase drivers, and I
> have been able to query data successfully.
>
> What changed yesterday is that a field from the management system has
> grown beyond 255 characters. It seems there is a limitation somewhere
> with the connection object. The management system handles the large
> field just fine. But when I try to query the very same field in my
> ASP application via my DBase-based connection object, it returns a
> truncated result at the 254th character (too close to 255 characters
> for a max varchar field size that I am accustomed to in SQL server).
>
> The data in the DBF is indeed not truncated. Only the result from my
> SQL statement is. Switching to the FoxPro driver does not change
> this.
>
> Can anyone help me modify the following code so that it converts the
> field type to, say, MEMO, so that the queried results are not
> truncated? Or perhaps I'm barking up the wrong tree and someone can
> tell me where else I've gone wrong. This is just the way I'm working
> with the cards I've been dealt.
>
> Thanks,
> Matt
>
> ---------------------------
>
> Set dbfConn = Server.CreateObject("ADODB.Connection")
> 'The DBase Connection String
> dbfConn.Open "Driver={Microsoft dBASE Driver "_
> & "(*.dbf)};DriverID=277;Dbq=C:\ManagementSys\Data\; "
>
> 'The Visual FoxPro Connection String
> 'dbfConn.Open "Driver=Microsoft Visual FoxPro " _
> '& "Driver;SourceType=DBF;SourceDB=C:\ManagementSys\D ata\;"_
> '& "BackgroundFetch=no;"
>
> Set dbfRS = Server.CreateObject("ADODB.Recordset")
>
> sql = "SELECT fieldX FROM tableY WHERE recordID = 1234"
> dbfRS.Open sql, dbfConn[/color]