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.CreateOb ject("ADODB.Con nection")
'The DBase Connection String
dbfConn.Open "Driver={Micros oft dBASE Driver "_
& "(*.dbf)};Drive rID=277;Dbq=C:\ ManagementSys\D ata\;"
'The Visual FoxPro Connection String
'dbfConn.Open "Driver=Microso ft Visual FoxPro " _
'& "Driver;SourceT ype=DBF;SourceD B=C:\Management Sys\Data\;"_
'& "BackgroundFetc h=no;"
Set dbfRS = Server.CreateOb ject("ADODB.Rec ordset")
sql = "SELECT fieldX FROM tableY WHERE recordID = 1234"
dbfRS.Open sql, dbfConn 4 6154
(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" <st********@yah oo.com> wrote in message
news:38******** *************** ***@posting.goo gle.com... 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.CreateOb ject("ADODB.Con nection") 'The DBase Connection String dbfConn.Open "Driver={Micros oft dBASE Driver "_ & "(*.dbf)};Drive rID=277;Dbq=C:\ ManagementSys\D ata\;"
'The Visual FoxPro Connection String 'dbfConn.Open "Driver=Microso ft Visual FoxPro " _ '& "Driver;SourceT ype=DBF;SourceD B=C:\Management Sys\Data\;"_ '& "BackgroundFetc h=no;"
Set dbfRS = Server.CreateOb ject("ADODB.Rec ordset")
sql = "SELECT fieldX FROM tableY WHERE recordID = 1234" dbfRS.Open sql, dbfConn
Aaron,
Thanks for the pointer. I've tried what you suggested without any
luck. The following code returns the exact same result:
---------------------------
Set dbfConn = Server.CreateOb ject("ADODB.Con nection")
'The DBase Connection String
dbfConn.Open "Driver={Micros oft dBASE Driver "_
& "(*.dbf)};Drive rID=277;Dbq=C:\ ManagementSys\D ata\;"
'The Visual FoxPro Connection String
'dbfConn.Open "Driver=Microso ft Visual FoxPro " _
'& "Driver;SourceT ype=DBF;SourceD B=C:\Management Sys\Data\;"_
'& "BackgroundFetc h=no;"
sql = "SELECT fieldX FROM tableY WHERE recordID = 1234"
dbfConn.Execute (sql)
---------------------------
Both the dBase and FoxPro drivers provide the same result.
BUT, there is new information I was not aware of. I was provided with
a text file which describes the different fields I'm working with
here. The particular field I am trying to query is of type ARRAY.
So, if I open up the DBF in notepad, the field appears as one long
string. But if you break it down, each element in the string
represents three pieces of information: a date and two
single-character codes for a total of ten characters. For example:
mmddyyyyax
Where a and x are the single character codes respectively. As more
elements are added to the field, in notepad it begins to look like
this:
mmddyyyyaxmmddy yyyaxmmddyyyyax mmddyyyyaxmmddy yyyaxmmddyyyyax
This has not been a problem until the field got beyond 255 characters.
I'm not sure if it's this ARRAY typing that is causing the issue.
I'd love more suggestions.
Matt
> sql = "SELECT fieldX FROM tableY WHERE recordID = 1234" dbfConn.Execute (sql)
What do you expect to happen here? You haven't assigned the results to
anything, you told the database to execute a SELECT statement, and it
probably did that no problem, but didn't send results anywhere because you
didn't tell it to...
mmddyyyyax
Where a and x are the single character codes respectively. As more elements are added to the field, in notepad it begins to look like this:
mmddyyyyaxmmddy yyyaxmmddyyyyax mmddyyyyaxmmddy yyyaxmmddyyyyax
Sorry, I know nothing about DBF's file format. This seems to be a FoxPro
issue, not an ASP one, so my only suggestion is to post your issue to a
FoxPro group. st********@yaho o.com (Matt Young) wrote in news:38******** *************** ***@posting.goo gle.com: BUT, there is new information I was not aware of. I was provided with a text file which describes the different fields I'm working with here. The particular field I am trying to query is of type ARRAY.
VFP doesn't support an array field type.
Also, have you tried downloading the VFP OLE DB provider from
<http://www.microsoft.c om/downloads/details.aspx?fa milyid=0f43eb58-7a94-4ae1-a59e-965869cb3bc9&di splaylang=en>?
Using the ODBC driver requires that you do something with GetChunk() which,
fortunately, I've never needed to do. :-) The OLE DB provider _might_
avoid this.
Garrett Fitzgerald
MailMovers
Seattle, WA This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: bwalke |
last post by:
Hi all,
I am fairly new to using triggers and was seeking some help from those
that have experience with them. I am looking to transfer data from a
SQL 2000 database to a Visual FoxPro database on another computer. I
would like to transfer about three fields of data to a VFP table each
time an insert is made on the SQL table. I am some what familiar with
the structure of creating the trigger but here is what I would like
help with: ...
|
by: Simon Bailey |
last post by:
I am a newcomer to databases and am not sure which DBMS to use. I have
a very simplified knowledge of databases overall. I would very much
appreciate a (simplifed) message explaining the advantages and
disadvantages of both programs.
Many Thanks
Simon
|
by: Sarah |
last post by:
Hi
I am using vb.net
Is it possible to fetch data from foxpro tables (vfp8) and update tables in sql server 2000? The table structures of the foxpro tables are different from those in sql server. Depending on the data fetched, I would like to update relavent table columns in sql server. How can this be done
Regards
Sarah
|
by: Ty Salistean |
last post by:
I think it would be nice if we could have a SQL engine available on the
client side. I primarily do Windows Forms programming and it seems that I
have to make alot of calls accross the wire to manipulate data for display
purposes.
I am a FoxPro guy but I have been in .NET for 1 year now. We have an
application in FoxPro hitting SQL Server and I think that system is
architected well. If I have a screen that requires the data to be...
|
by: Robert Hooker |
last post by:
I have installed our .NET application on a system running Microsoft Windows
Vista operating system.
When I run our application, I receive the following error message whenever
it tries to create a DBF file using VFPODBC:
"ERROR Driver does not support this
function"
I am using a connection string that I have used for many years with no
problems, here is some sample C# code:
| |
by: The One |
last post by:
Hi,
I'm working on a project which needs 10 GB of foxpro database needed to
be migrated to DB2. Please suggest me some database migration strategy
or is there any tool which can import data from foxpro onto DB2?
Could anyone let me know which is the right place/site to
start my research?
Thanks in advance.
|
by: Songyang |
last post by:
I'm new to this group. In my company in Japan, we have been using dbase
for almost 20 years, and we are now switching to foxpro.
Dose anybody here has experience in converting dbase programs from
Dbase to Foxpro ones? It seems the data conversion is not hard. But we
have hundreds of dbase programs that need to be converted to foxpro
ones. Could you please give me some advice? And here special tools for
this?
|
by: ray well |
last post by:
i need to access a legacy database that uses dBase files running under
foxpro for read only purposes, within net 2.0, ado 2.0, and sql
statements. i have no problem getting the info i need, but it is very slow.
i'm not using any indexes which the databases have, *.idx files, i don't
know how to access them.
the connection string i use is:
Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=dBASE
IV;User ID=Admin;Password=;Data...
|
by: Johny |
last post by:
Is there a module for reading/modifing db files from Python?
Thanks for help
B.
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |