Re: Vb.net Ms Access Database 2007 Reusable Procedures/queries/functions

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks for the information will have a read and then make a decision for the
way forward.

Thanks again :-)


"sloan" <sloan@xxxxxxxxx> wrote in message
news:OkOf95eEKHA.2832@xxxxxxxxxxxxxxxxxxxxxxx
I believe you can use the EnterpriseLibrary.Data with "parameterized
queries" in Jet.


Create a "query" in the Jet Database through the MS Access Front End
application.

PARAMETERS pEmail Text ( 255 );
INSERT INTO MyTable ( EmailAddress )
SELECT [pEmail];

name the query "procEmailUpdate".


EnterpriseLibrary.Data snipplet below. The syntax might be slightly off,
but its close.


Database db = null;
System.Data.DbCommand dbc = null;
db = this.GetDatabase(); // encapsulated, code not shown here
dbc = db.GetStoredProcCommandWrapper ( "procEmailUpdate" );
dbc.AddInParameter ("pEmail" ,DbType.String , "aaa@xxxxxxx" );


int result = db.ExecuteNonQuery(dbc);

}






"sloan" <sloan@xxxxxxxxx> wrote in message
news:eQ80$PeEKHA.3708@xxxxxxxxxxxxxxxxxxxxxxx

The preferred solution is to move to Sql Server CE or Sql Server Express.

You can look here
http://support.microsoft.com/kb/202116

I would look here:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!176.entry
And download the code.

Aspect#1
If you're bent on sticking with a Jet database, then you can look at
CustomerDataBaseLine.cs
It is simple dynamic sql.

Aspect#2
You can also look at the Sql Server CE example.
Aka, consider moving to it.

Aspect#3
Even if you're bent on staying with a Jet database right now, you CAN
architect your code so you're not married to it.
That is the primary reason for the example code. How to use a Jet
backend, but not be married to it forever.
The effort is well worth it up front so you have an option in the future.







"Rob W" <robwha@xxxxxxxx> wrote in message
news:u19bdNWEKHA.4004@xxxxxxxxxxxxxxxxxxxxxxx
Greetings,

This question is a mixture of ms access and vb.net I guess.

My application utilises an access 07 database and a frequent sql query
is to count the rows where columnA = textbox.text or
combobox.selectedvalue etc..,

This is hardcoded into each module, so took an opportunity to go about
reuses sql code.

I was looking into the OleDD commandtype and noticed it could run a
stored procedure, then found out MS access is not capable of creating a
true stored procedure but can create procedures via DDL.

I was messing around with access and noticed any query I created when
accessed via vb.net existed as a function.

What is the preferred method to reuse and execute SQL for a ms access 07
database in vb.net?
Can I access and run the database function from within vb.net?

Any help or advice would be appreciated

Thanks
Rob







.



Relevant Pages

  • Re: DBMS and lisp, etc.
    ... Naively implemented with SQL, again for 10 ... (1 query for the initial orders, 1 query for each order for its ... soon as you upgrade to the SQL database. ... (eq (order-customer orderA) ...
    (comp.lang.lisp)
  • Re: complex filter and calculations in access
    ... switch to SQL view. ... query by switching to datasheet view, ... of your database using the from address in this post. ... pre-op infections yes/no ...
    (microsoft.public.access.queries)
  • Re: A little more meat this week
    ... implementation with a query processor capable of returning a result set ... then we can call it a result bag (SQL ... I'm looking at the data model and not database tools at this ... for a s/w developer and a s/w developer simplifies for the end user). ...
    (comp.databases.pick)
  • Re: complex filter and calculations in access
    ... when using a subquery on the same table as the main query, ... switch to SQL view. ... of your database using the from address in this post. ...
    (microsoft.public.access.queries)
  • Re: A little more meat this week
    ... said data includes lists." ... implementation with a query processor capable of returning a result set ... then we can call it a result bag (SQL ... I'm looking at the data model and not database tools at this ...
    (comp.databases.pick)