Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 999943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:25:55+00:00 2026-05-16T07:25:55+00:00

I have an asp.net website that needs to connect to a dBase file on

  • 0

I have an asp.net website that needs to connect to a dBase file on a remote server. The remote server has a ODBC System DSN connection configured but I have no idea how to connect to it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T07:25:55+00:00Added an answer on May 16, 2026 at 7:25 am

    The ODBC connection on the server won’t help you. The ODBC Connection needs to be set up on the machine you want to connect FROM, not the one you want to connect TO.

    In order to connect to the DBASE files (and treat them like a database) you will need to

    1. Map a drive so that you can access the location of the files..
    2. Connect use the OleDbConnection.

    It ALSO deals with a problem you will have reading DBase files from .NET. If you read them often enough, the app will start throwing a “System.Resources.Exceeded” exception. The only reliable solution I’ve found has been to kill the app and restart it, which is done in the code named FixMyself. (Not included as it contains sensitive data). The FixMyself routine essentially starts a second exe that kills THIS exe and then restarts it.

    The sample code below is copied from production code, and should give you a push int he right direction. it maps the drive, connects, and reads.

    It’s ugly but it works. It’s also only partial as it calls several functions not included here. But again, it should be enough to get you going.

      Public Function GetRegisterConnectionString(ByVal PathToFolder As String)
            Return "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & PathToFolder & ";Extended Properties=dBASE IV;User ID=Admin;Password="
        End Function
        Public Sub ReadMyDbaseFile(ByVal DriveLetter As String, ByVal IPAddress As String)
    
            Dim DpalmPath As String = "\\" & IPAddress & "\c$\Dpalm"
            Dim cn As New System.Data.OleDb.OleDbConnection("")
            cn.ConnectionString = Me.GetRegisterConnectionString(DpalmPath)
            If ds.Tables.Contains("CurrentPrices") Then
                ds.Tables.Remove("CurrentPrices")
            End If
    
        Dim POSAdapter As New System.Data.OleDb.OleDbDataAdapter("select * From MyDbaseFile WHERE SomeField > 0 AND ACTIVE = -1", cn)
    
        Try
            POSAdapter.Fill(ds, "CurrentPrices")
    
        Catch ex As Exception
            If InStr(ex.ToString().ToLower(), "system resource exceeded") Then
                WriteToLog("System Resource Exceeded Error was thrown on register " & DriveLetter & ", IP " & IPAddress & ".")
                Me.FixMyself()
            Else
                Throw New Exception(ex.ToString())
            End If
        End Try
        ds.Tables("CurrentPrices").Columns.Add("LastModified", GetType(Date))
        POSAdapter.Dispose()
        POSAdapter = Nothing
        cn.Dispose()
        cn = Nothing
        ds.AcceptChanges()
    
        GC.Collect()
    
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET MVC website which has a particular javascript file that needs
I have an ASP.NET website on a Windows 2003 Server, that needs to access
We have a large ASP.Net website that has a single css stylesheet which is
I have a website that is built in ASP.NET 3.5 & SQL Server 2005,
I have a website that started with ASP.NET and over time has had some
I have a ASP.Net website that is failing on AJAX postbacks (both with ASP.Net
I have an asp.net website that allows the user to download largish files -
I have an asp.net website that uses forms authentication. There are a few things
I have an ASP.NET website that is contacting a webservice. Everything works fine connecting
I have an ASP.NET MVC website that works in tandem with a Windows Service

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.