Hi there,
I'm currently trying to create a MS access file at runtime, but I stumble
into some problems.
1. When I use Datatype adUnsignedInt I get an error (invalid type).
2. Which datatype must I use to create an autonumbering field?
3. Which datatype must I use to create an OLE-object field?
I'm currently using Microsoft ActiveX Data Objects Library 2.8 and using
engine type 5.
Can anybody help me out here?
thnx 10 2902
On Sun, 19 Nov 2006 16:09:53 +0100, "C# Beginner" <de********@orange.nlwrote:
>Hi there,
I'm currently trying to create a MS access file at runtime, but I stumble into some problems. 1. When I use Datatype adUnsignedInt I get an error (invalid type). 2. Which datatype must I use to create an autonumbering field? 3. Which datatype must I use to create an OLE-object field?
I'm currently using Microsoft ActiveX Data Objects Library 2.8 and using engine type 5.
Can anybody help me out here?
thnx
Is the database you are trying to create always the same(schema-wise)? If it is
why not just distribute an empty DB with all the tables, etc. already created
and copy it when you want to create a new one?
Additionally, DAO is still a viable option for doing this. To use it just add
the dll to your project.
Good luck with your project,
Otis Mukinfus http://www.arltex.com http://www.tomchilders.com
Hi Otis,
Thanks for the rapid respons.
I'm currently rewriting a program which I developed in VB6 using DAO, in
which users were able to create
their own databases at demand (no schema). I like to keep it that way.
My problem is that DataTypeEnum contains a lot of types of which some can't
be used (so it seems). So I need to understand if and how each type works.
OLE-object type and Autonumber are examples of types which aren't available
in DatatTypeEnum, so I must find an alternative type for them.
There are a lot of examples how the create a access database at runtime, but
I still can't find the solution for my problem. Most examples aren't writing
c# anyway.
thnx
DD
"Otis Mukinfus" <ph***@emailaddress.comschreef in bericht
news:c0********************************@4ax.com...
On Sun, 19 Nov 2006 16:09:53 +0100, "C# Beginner" <de********@orange.nl>
wrote:
>>Hi there,
I'm currently trying to create a MS access file at runtime, but I stumble into some problems. 1. When I use Datatype adUnsignedInt I get an error (invalid type). 2. Which datatype must I use to create an autonumbering field? 3. Which datatype must I use to create an OLE-object field?
I'm currently using Microsoft ActiveX Data Objects Library 2.8 and using engine type 5.
Can anybody help me out here?
thnx
Is the database you are trying to create always the same(schema-wise)? If
it is
why not just distribute an empty DB with all the tables, etc. already
created
and copy it when you want to create a new one?
Additionally, DAO is still a viable option for doing this. To use it just
add
the dll to your project.
Good luck with your project,
Otis Mukinfus http://www.arltex.com http://www.tomchilders.com
"C# Beginner" <de********@orange.nlwrote in message
news:45***********************@news.wanadoo.nl...
There are a lot of examples how the create a access database at runtime,
but I still can't find the solution for my problem. Most examples aren't
writing c# anyway.
Did you actually read Otis' reply?
How many different versions of this Access (by which, of course, you mean
Jet) database do you need to create...?
Hi Mark,
Sorry, it seems that my english is a little bit poor, but I thought I
mentioned that the creation of databases depends on the users wishes at
runtime (have you actually read my mail?).
Though I thank Otis for his rapid respons and suggestion, his solution will
not do for my project.
The usage of DAO can be a solution, but I rather try it with .NET elements
(ADO/ADOX), since DAO is (officialy) not supported in .NET.
Back to my project. Think of it like VisData which was included in Visual
Studio 6.
DD
"Mark Rae" <ma**@markNOSPAMrae.comschreef in bericht
news:el**************@TK2MSFTNGP06.phx.gbl...
"C# Beginner" <de********@orange.nlwrote in message
news:45***********************@news.wanadoo.nl...
>There are a lot of examples how the create a access database at runtime, but I still can't find the solution for my problem. Most examples aren't writing c# anyway.
Did you actually read Otis' reply?
How many different versions of this Access (by which, of course, you mean
Jet) database do you need to create...?
"C# Beginner" <de********@orange.nlwrote in message
news:45***********************@news.wanadoo.nl...
but I thought I mentioned that the creation of databases depends on the
users wishes at runtime
You didn't - you said "I'm currently trying to create a MS access file at
runtime" and then mentioned some of the DDL issues you were facing - no
mention that the database needs to be different for each user...
(have you actually read my mail?).
Yes.
The usage of DAO can be a solution, but I rather try it with .NET elements
(ADO/ADOX), since DAO is (officialy) not supported in .NET.
ADOX is probably your best choice, even though it is not officially
supported in .NET either... http://support.microsoft.com/kb/317881 http://www.google.co.uk/search?sourc...&q=%2eNET+ADOX
Hi Mark,
Sorry I wasn't specific in my first mail, but I thought my response to Otis
was clear enough.
Maybe I was or maybe I wasn't.... no need to argue here. Next time I try to
choose my words more carefully and be more specific. (Though it's no easy
when trying to communicate in a language that is my native language, but I'm
still learning).
Enough said.
For anybody who's interested.... http://www.codeguru.com/cpp/data/mfc...cle.php/c4343/
Now I only have to figure out how to translate
'col.Properties["AutoIncrement"] = true'. It does work in VB, but it seems
that the Properties collection is readonly in C#.
thnx for the interesting links Mark
DD
"Mark Rae" <ma**@markNOSPAMrae.comschreef in bericht
news:uI**************@TK2MSFTNGP04.phx.gbl...
"C# Beginner" <de********@orange.nlwrote in message
news:45***********************@news.wanadoo.nl...
>but I thought I mentioned that the creation of databases depends on the users wishes at runtime
You didn't - you said "I'm currently trying to create a MS access file at
runtime" and then mentioned some of the DDL issues you were facing - no
mention that the database needs to be different for each user...
>(have you actually read my mail?).
Yes.
>The usage of DAO can be a solution, but I rather try it with .NET elements (ADO/ADOX), since DAO is (officialy) not supported in .NET.
ADOX is probably your best choice, even though it is not officially
supported in .NET either... http://support.microsoft.com/kb/317881 http://www.google.co.uk/search?sourc...&q=%2eNET+ADOX
On Mon, 20 Nov 2006 07:58:49 +0100, "C# Beginner" <de********@orange.nlwrote:
>Hi Mark,
Sorry, it seems that my english is a little bit poor, but I thought I mentioned that the creation of databases depends on the users wishes at runtime (have you actually read my mail?).
Though I thank Otis for his rapid respons and suggestion, his solution will not do for my project.
The usage of DAO can be a solution, but I rather try it with .NET elements (ADO/ADOX), since DAO is (officialy) not supported in .NET.
[snip]
C# Beginner,
Your original post said absolutely nothing about users creating their own
tables, etc. Have you bothered to go back and read your original post? Don't
be trying to get a splinter out of mine and Mark's eyes without first taking off
the blindfold you are wearing.
ADOX is not an element of the .NET framework. That is why you will not see it
listed if you type "ADOX" into the Visual Studio Help Index, but you WILL find
"DAO" if you type it in. Which do YOU think MS would rather you use????.
If you want an entirely .NET solution, then I suggest you ditch the Jet database
technology and use SQL server 2005 Express (free) or the new SQL Server Compact
Edition (not very well supported yet, but also free).
There is no reason you cannot have an empty Jet database for distribution and
then USE DDL to create the tables, etc for the user. Write the DDL script and
execute it with the ExecuteNonQuery method of the OLEDB provider. Copying the
Jet DB file is about three or four lines of code and I'm sure you know how to
write the DDL.
Good luck with your project,
Otis Mukinfus http://www.arltex.com http://www.tomchilders.com
"Otis Mukinfus" <ph***@emailaddress.comwrote in message
news:l6********************************@4ax.com...
ADOX is not an element of the .NET framework. That is why you will not
see it
listed if you type "ADOX" into the Visual Studio Help Index, but you WILL
find
"DAO" if you type it in.
Indeed.
If you want an entirely .NET solution, then I suggest you ditch the Jet
database
technology and use SQL server 2005 Express (free) or the new SQL Server
Compact
Edition (not very well supported yet, but also free).
In fact, Access 2007 does not even use the old Jet database format by
default: http://office.microsoft.com/en-us/ac...678311033.aspx
though, obviously, it *can* still work with the previous version...
There is no reason you cannot have an empty Jet database for distribution
and
then USE DDL to create the tables, etc for the user. Write the DDL script
and
execute it with the ExecuteNonQuery method of the OLEDB provider. Copying
the
Jet DB file is about three or four lines of code and I'm sure you know how
to
write the DDL.
Actually, that is probably the best solution - no need for ADO, ADOX or DAO
at all...
Sorry for the confusion. It is correct I said nothing about users creating
their own databases in my first question. I mentioned it only later in my
first response to your first suggestion. I should have made that clearer in
my response to Mark. Sorry Mark.
Though I almost have the answer to my problem, you suggestion of using an
empty database and use later on the DDL to add more tables as wished by
other users, never crossed my mind. I was fixed on using only one method
(ADOX or DAO) and never thought of combining two methods (ADOX and DDL).
thnx for the tip.
DD
"Otis Mukinfus" <ph***@emailaddress.comschreef in bericht
news:l6********************************@4ax.com...
On Mon, 20 Nov 2006 07:58:49 +0100, "C# Beginner" <de********@orange.nl>
wrote:
>>Hi Mark,
Sorry, it seems that my english is a little bit poor, but I thought I mentioned that the creation of databases depends on the users wishes at runtime (have you actually read my mail?).
Though I thank Otis for his rapid respons and suggestion, his solution will not do for my project.
The usage of DAO can be a solution, but I rather try it with .NET elements (ADO/ADOX), since DAO is (officialy) not supported in .NET.
[snip]
C# Beginner,
Your original post said absolutely nothing about users creating their own
tables, etc. Have you bothered to go back and read your original post?
Don't
be trying to get a splinter out of mine and Mark's eyes without first
taking off
the blindfold you are wearing.
ADOX is not an element of the .NET framework. That is why you will not
see it
listed if you type "ADOX" into the Visual Studio Help Index, but you WILL
find
"DAO" if you type it in. Which do YOU think MS would rather you use????.
If you want an entirely .NET solution, then I suggest you ditch the Jet
database
technology and use SQL server 2005 Express (free) or the new SQL Server
Compact
Edition (not very well supported yet, but also free).
There is no reason you cannot have an empty Jet database for distribution
and
then USE DDL to create the tables, etc for the user. Write the DDL script
and
execute it with the ExecuteNonQuery method of the OLEDB provider. Copying
the
Jet DB file is about three or four lines of code and I'm sure you know how
to
write the DDL.
Good luck with your project,
Otis Mukinfus http://www.arltex.com http://www.tomchilders.com
"C# Beginner" <de********@orange.nlwrote in message
news:45***********************@news.wanadoo.nl...
Though I almost have the answer to my problem, you suggestion of using an
empty database and use later on the DDL to add more tables as wished by
other users, never crossed my mind. I was fixed on using only one method
(ADOX or DAO) and never thought of combining two methods (ADOX and DDL).
No need for ADOX - that's the whole point...
1) Using Access (or whatever) create a totally blank database.
2) Add the totally blank database to your project as an embedded resource.
3) When you need to create a new database, extract the database from your
project and save it somewhere for the user
4) Add the various object to it as required by passing DDL SQL to the
ExecuteQuery method This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Dim St Thomas |
last post by:
I am a developer working on a database client program. I am testing this
program on a Windows XP machine (1.5 GHz AMD chip, 480 Mb RAM, 60 Gb disk)
This machine has Oracle 9.2.0.1.0 and RedBrick...
|
by: Tony |
last post by:
G'day
My attempt to create an MDE file was unsuccessful. The attempt produced an
error that effectively said the (MDB) file was to big. The MDB consists of
about 30 tables, 50 forms and 3...
|
by: John Baker |
last post by:
Hi:
I would like to know how to create a temp DB to store the data in a table while I do
something else with the table.
Specifically, how do I
create the temp
remove the temp
I want to be...
|
by: Jerry Spence1 |
last post by:
Why doesn't the following work in my ASP program? I have imported ADOX
I am trying to create a temporary database on the user's PC. The example is
taken from Microsoft.
Dim cat As Catalog =...
|
by: John Dann |
last post by:
Apologies if this isn't the best group - maybe someone can suggest a
more appropriate one - I can't immediately see anything on ado.net.
I need to store a significant amount of data (say 1-10MB)...
|
by: dennist685 |
last post by:
Walkthrough: Creating a Web Page to Display Access Database Data
I've started the above walkthrough. However, near the beginning it gives
the following instructions
To set permissions in the...
|
by: dave |
last post by:
Hello:
In Visual Studio 6.0 there is "VisData"
to create Access database files. (file.MDB".
Q:
Does Visual Studio 2005 have tool(s)
that create Access database files (file.MDB) ?
thank...
|
by: RSH |
last post by:
Hi,
I have a situation where I have created a little application that makes an
Access database from a SQL Database for reporting purposes. it does the job
well, but it seems a bit slow. Is...
|
by: Andy |
last post by:
Hi guys
I having a problem creating a report in Access 2003 project talking to
a SQL database through and ODBC connect.
After hours of trying things from Access Help, MSDN and Google I still...
|
by: sainiamit25 |
last post by:
Hi,
I want to create a materlised view log in my database A and materlised view in some other database B. I was successful in creating materlised view in database B (after creating a dblink with...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
|
by: isladogs |
last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, Mike...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
| |