473,769 Members | 2,348 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DBASE file connection problem :(

Hi all,

I wanted to connect an old DBASE file (I don't know the exact version) but I
could not make it at all. I couldn't find a way to execute sql statements on
db file using c#. The interesting thing my old client can connect to the
database and fetch data properly.

I tried all possibilities that I found on the web containing using ODBC
driver and importing the data into an access file and using this file
instead of working on the original file but I couldn't achieve these too.

I also used the all connections strings that connectionstrin gs.com suggests
but this didn't work too.

My data folder consists of a DBF, FPT and CDX file (afaik this file comes
only with the newer versions of DBASE). This may be helpful for you.

Any help will be appreciated.
Thanks in advance.
Apr 3 '07 #1
6 3801
Alenya,

The most important thing that you left out was the code that you are
using to access the file! Are you using the classes from the
System.Data.Odb c namespace? You mentioned an ODBC driver, and this is the
namespace that you would use to connect to data sources through ODBC
drivers.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Aleyna[]" <xo******@gmail .comwrote in message
news:Oh******** ******@TK2MSFTN GP02.phx.gbl...
Hi all,

I wanted to connect an old DBASE file (I don't know the exact version) but
I could not make it at all. I couldn't find a way to execute sql
statements on db file using c#. The interesting thing my old client can
connect to the database and fetch data properly.

I tried all possibilities that I found on the web containing using ODBC
driver and importing the data into an access file and using this file
instead of working on the original file but I couldn't achieve these too.

I also used the all connections strings that connectionstrin gs.com
suggests but this didn't work too.

My data folder consists of a DBF, FPT and CDX file (afaik this file comes
only with the newer versions of DBASE). This may be helpful for you.

Any help will be appreciated.
Thanks in advance.

Apr 3 '07 #2
Thanks for reminding...

I used the following code:

string dbName = "dsn=lugat" ;

OdbcConnection odbcConn = new OdbcConnection( dbName);
try
{
odbcConn.Open() ;
//I write all tables into an XML file in order to ensure it works properly
or not
odbcConn.GetSch ema(OdbcMetaDat aCollectionName s.Tables).Write Xml("TABLES.XML "); string cmdText = "Select * from LUGAT"; OdbcCommand cmd = new OdbcCommand(cmd Text,odbcConn); OdbcDataReader reader = cmd.ExecuteRead er();}catch (Exception e){ throw e;}finally{ odbcConn.Close( );}and this is what the code writes to the TABLES.XML file<?xml version="1.0" standalone="yes "?><DocumentEle ment <Tables <TABLE_CAT>D:\L UGAT</TABLE_CAT <TABLE_NAME>LUG AT</TABLE_NAME <TABLE_TYPE>TAB LE</TABLE_TYPE </Tables <Tables <TABLE_CAT>D:\L UGAT</TABLE_CAT <TABLE_NAME>LUG AT_SET</TABLE_NAME <TABLE_TYPE>TAB LE</TABLE_TYPE </Tables></DocumentElement >However when I tried to access the db using the select statement it throwsan exception saying"Error [HY000][Microsoft][ODBC dBase Driver] External table is not in theexpected format."any ideas?"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om>, haberiletisinde şunları yazdı:On******* *******@TK2MSFT NGP03.phx.gbl.. .Alenya,> The most important thing that you left out was the code that you areusing to access the file! Are you using the classes from theSystem.Data. Odbc namespace? You mentioned an ODBC driver, and this is thenamespace that you would use to connect to data sources through ODBCdrivers.> Hope this helps.>>-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard. caspershouse.co m>"Aleyna[]" <xo******@gmail .comwrote in messagenews:Oh* *************@T K2MSFTNGP02.phx .gbl...>Hi all,>>>I wanted to connect an old DBASE file (I don't know the exact version)but I could not make it at all. I couldn't find a way to execute sqlstatements on db file using c#. The interesting thing my old client canconnect to the database and fetch data properly.>>>I tried all possibilities that I found on the web containing using ODBCdriver and importing the data into an access file and using this fileinstead of working on the original file but I couldn't achieve these too.>>>I also used the all connections strings that connectionstrin gs.comsuggests but this didn't work too.>>>My data folder consists of a DBF, FPT and CDX file (afaik this file comesonly with the newer versions of DBASE). This may be helpful for you.>>>Any help will be appreciated.>Th anks in advance.>>>>

Apr 3 '07 #3
A dbase file, not a forpro db file? what version?

maybe,you should translate it to forpro3.0 file first.(using vfp6)
Apr 4 '07 #4
A dBase file. I do not know the version but tried to connect using dBASE 3,4
and 5 drivers.

Now I found a tool to transfer the data into a mySQL db however still I
could not understand why I cannot connect and query properly whereas others
can make it.
"gshzheng" <gs******@gmail .com>, haber iletisinde şunları
yazdı:%2******* *********@TK2MS FTNGP04.phx.gbl ...
>A dbase file, not a forpro db file? what version?

maybe,you should translate it to forpro3.0 file first.(using vfp6)



Apr 4 '07 #5


hi alena,
if u want to connect using SSIS means i can help.otherwise so sorry.

thx
sr*********@gma il.com

*** Sent via Developersdex http://www.developersdex.com ***
Feb 1 '08 #6
hi alenya,
if needed to connect using SSIS means i can help u. otherwise so sorry

thx
sreejith

*** Sent via Developersdex http://www.developersdex.com ***
Feb 1 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
2201
by: Stan Cook | last post by:
Does anyone know how or what I can use to open, read and extract data from a dbase database? I haven't found anything of much use with accompanying documentation.
4
6154
by: Matt Young | last post by:
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...
10
7923
by: level8 | last post by:
I would like to see a Clipper/dbase DBF file as a table in SQL Server 7.0. How can I SELECT rows from DBF file? Should I use OLE DB Provider or ODBC, and how?
3
6669
by: Kshitij Rajhans | last post by:
HI, How to connect to the dBase database?? One option is to create a DSN and use it.But I want to do it in some other way like just passing a connection string or like that. Thanks in advance. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
1
5261
by: Derek Griffiths | last post by:
Most of the complicated programs I write are boring applications that manipulate databases associated with the medical billing program where I work. The program uses foxpro dbases (version 3) for all of its' data. I'm running into a strange problem that I believe has something to do with the actual dbase file, but I couldn't find anything on google. Each group of doctors has its' own patient and billing tables. I can read the billing...
6
4132
by: Tomek | last post by:
Hi, Please help me with Data Connections into dBase files. I have catalog with lot of files like *.dbf and *.mdx . Every file contains one table (I can see it in MS Access). How can I make connections into this/that folder/files in VB.NET project? Tomek
4
1749
by: JeffP | last post by:
datagrid1 has a single column contact I'm getting an invalid datasource at... Me.DataGrid1.DataSource = cmd I don't want to use the methods here, I usually use SQLHelper psuedo code: dim ds as new dataset = execute(....... I just want to get my single colum populated.....
2
11155
by: bcbrock | last post by:
I am trying to figure out how to query some data out of a dbase IV (.dbf) file sitting on a remote server from my MySQL/PHP/Web Server. Both servers are Windows Server 2003 SP2. My MySQL/PHP/Web server is running PHP 4.3.11, MySQL 4.0.24, and IIS. I have set a system DSN on the remote machine for the directory that contains the dbase file. The DSN name is SASIxp, and the actual file I'm trying to connect to is ADST.DBF.
1
3942
by: JFB | last post by:
Hi, I have a connection to a dbase IV file using oledb. I wan to do an update to a field using a vb function passing two parameters. These 2 parameters are fields from the same table. What is the sintax to do this? Thanks JFB ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
0
9586
marktang
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...
0
9423
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,...
0
10210
Oralloy
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...
0
10043
jinu1996
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...
1
9990
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7406
isladogs
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...
0
5298
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...
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.