lontek
asked on
Database Error (Invalid File name) Delphi 2
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!
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!
maybe the path is toooooo long
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
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
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
Hope this could help you.
Regards, Dewo
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!
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!
ASKER
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!
FAT16 and the Database stuff worked fine immediately.
Thanks to all anyway for the advice and happpy computing!
ASKER
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.
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.
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
Computer101
E-E Admin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.