?
Solved

Database Error (Invalid File name) Delphi 2

Posted on 2003-02-26
8
Medium Priority
?
703 Views
Last Modified: 2010-04-04
Hello,
Everytime I attempt to access a database from within Delphi I get a Database error-Invalid filename. Even Delphi's own example Bdase files will not open. I can go into Delphi's included Database explorer program and open the databases and manipulate the data and even save them successfully, no problem. But as soon as I open Delphi and try to open any database I get the above error!
Any suggestions? It appears to be a bug of some sort as I even tried it on my Windows 98SE and got the same result.
The machine I am running Delphi 2 on has  Windows 95 "B"
on it.I am new to programming and I am not sure how much I want to invest in it yet. So I know the easy answer might be "get a current version of Delphi",but I was hoping someone in here might remember this error or perhaps can point me in the right direction. I am getting the error despite using only the Delphi provided Dbase stuff (DBase and Paradox).

Thanks in advance for any help!
0
Comment
Question by:lontek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 8031281
maybe the path is toooooo long
0
 
LVL 4

Expert Comment

by:delphi3
ID: 8034591
Hi lontek,
I am a newbie in database, so perhaps I might share with you that I had similar problems and my fixes.  I have D4  standard edition so that I may have some Borland 'made improvements' that you may not have in D2. I have also Win2K.

Have you first experimented with the other demos showing the databases that were supplied with your D2 disk??
Do the samples run without a problem in Delphi?
Do you know how to observe the form (.dfm) as text? this is what I have supplied to you below in addition to the .pas.

Now some ideas.
 
The DatabaseName is important - that is the 'clue' to the location of the folder that holds the file that you wish to access (believe it or not!!!). The TableName is the name within the folder of the table you wish to view. Then setting the Table1 must be active (true)for viewing.

unit DBTableViewerUnit1;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  ExtCtrls, DBCtrls, Grids, DBGrids, Db, DBTables;

type
  TForm1 = class(TForm)
    Table1: TTable;
    DataSource1: TDataSource;
    DBGrid1: TDBGrid;
    DBNavigator1: TDBNavigator;

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.DFM}



end.

the .dfm as text  

object Form1: TForm1
  Left = 513
  Top = 147
  Width = 388
  Height = 246
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -13
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 120
  TextHeight = 16
  object DBGrid1: TDBGrid
    Left = 32
    Top = 64
    Width = 320
    Height = 120
    DataSource = DataSource1
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -13
    TitleFont.Name = 'MS Sans Serif'
    TitleFont.Style = []
    Columns = <
      item
        Expanded = False
        FieldName = 'LastName'
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'FirstName'
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'Department'
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'Branch'
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'Senior'
        Visible = True
      end
      item
        Expanded = False
        FieldName = 'HireDate'
        Visible = True
      end>
  end
  object DBNavigator1: TDBNavigator
    Left = 64
    Top = 24
    Width = 240
    Height = 25
    DataSource = DataSource1
    TabOrder = 1
  end
  object Table1: TTable
    Active = True
    DatabaseName = 'DBDEMOS'
    TableName = 'Workers.DB'
    Left = 328
    Top = 24
  end
  object DataSource1: TDataSource
    DataSet = Table1
    Left = 16
    Top = 24
  end
end
 
0
 
LVL 1

Expert Comment

by:dewo
ID: 8034599
Try to make an alias, you can do that in Database Desktop. Use that alias to connect your db file. Don't forget to use TDatabase component.
Hope this could help you.

Regards, Dewo
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:khalil_moghaddam
ID: 8035987
Hi, lontek
you must explain more about the steps you do and your needs

which step did u do for using database?
what database engine did u use?
how did you try to connect to database?
did u set ConnectionString properties?

connecting to A DATABASE is so easy!

0
 
LVL 1

Author Comment

by:lontek
ID: 8041827
I did some searching and digging on the internet and found out that the version of DBE that shipped with Delphi 2 is not compatible with FAT32 drives. This would also explain why I got the same error on my Win98 machine. I loaded Delphi on my old Win95 machine running Win95 Version "A"
FAT16 and the Database stuff worked fine immediately.
Thanks to all anyway for the advice and happpy computing!
0
 
LVL 1

Author Comment

by:lontek
ID: 8072849
I will attempt to delete this question.
Upon continuing research I was able to find the answer myself. Borland has a patch on their web-site that upgrades the BDE from 3.5 to 3.5f. The patch upgrades the Borland Database Engine to accept FAT 32 drives.

Thanks.
0
 
LVL 1

Expert Comment

by:Computer101
ID: 8092244
A request for deletion has been made.  If no response or you feel this is in error, comment.  If no objection, I will delete in three days.

Computer101
E-E Admin
0
 
LVL 6

Accepted Solution

by:
Mindphaser earned 0 total points
ID: 8153903
Points refunded and moved to PAQ

** Mindphaser - Community Support Moderator **
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month14 days, 16 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question