Programmatically creating ADO.NET database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am an amateur programmer and trying to move from VB6 to VB.net.

I can't figure out how to create a ADO.NET database in code. I know how to
create a dataset and wonder whether there is a way to "export" it into a new
empty database.

Since I am at it: How do you programmatically store a query into an ADO
database?
I am using ADOX to create an ADO database.

Thanks for any help.

Peter Schoots
 
Peter said:
I am an amateur programmer and trying to move from VB6 to VB.net.

I can't figure out how to create a ADO.NET database in code. I know how to
create a dataset and wonder whether there is a way to "export" it into a new
empty database.

Since I am at it: How do you programmatically store a query into an ADO
database?
I am using ADOX to create an ADO database.

Thanks for any help.

Peter Schoots

"How do you programmatically store a query into an ADO database?"

You want to create a stored procedure? or are you using MS Access to
store a query and recall it later? It would help to know the database
you are talking to.

Chris
 
I am trying to create an Access database in code. In VB6 I used the
following code to create a ADO database.
cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strFileName & ";" & _
"Jet OLEDB:Engine Type=5")

How is this done for ADO.net?

With respect of the Query question: I used for a DAO database the following
line to store a query.

newQdf = db.CreateQueryDef("StartingDate", strSql)

What is the equivalent for ADO? (I don't mean ADO.NET but the "old" ADO)

Peter Schoots
 
Peter,

You cannot use ADONET to create an Access database.

However if it is there you can use it, did you see this sample.

http://www.vb-tips.com/default.aspx?ID=e76b8450-4c8a-4662-8f41-d6dda3c888c8

I saw that you saw the link to ADO

ADO had in past some very famous football players.

I think that the most famous player was Ad Mansveld but he is not the only
one, however I can be wrong in that. It was a long time ago, in the time
there was also DOS which was number 4 and that kind of clubs.

Just after the introduction of proffesional footbal in holland and before
that.

However, I am not from theHague, I am and was never a real football fan.

Cor
 
¤ I am trying to create an Access database in code. In VB6 I used the
¤ following code to create a ADO database.
¤ cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" & _
¤ "Data Source=" & strFileName & ";" & _
¤ "Jet OLEDB:Engine Type=5")
¤
¤ How is this done for ADO.net?
¤

Same method. There is no native method in ADO.NET

http://support.microsoft.com/default.aspx?scid=kb;en-us;317867

¤ With respect of the Query question: I used for a DAO database the following
¤ line to store a query.
¤
¤ newQdf = db.CreateQueryDef("StartingDate", strSql)
¤
¤ What is the equivalent for ADO? (I don't mean ADO.NET but the "old" ADO)
¤

If you don't want to use DAO or ADOX (ADO) you can use Jet SQL:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/acadvsql.asp

For ADO you use ADOX (Microsoft ADO Ext. 2.x for DDL and Security):

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnacc2k/html/adocreateq.asp


Paul
~~~~
Microsoft MVP (Visual Basic)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top