Re: Vb.net Ms Access Database 2007 Reusable Procedures/queries/functions
- From: "Rob W" <robwha@xxxxxxxx>
- Date: Fri, 31 Jul 2009 20:46:44 +0100
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
.
- Follow-Ups:
- References:
- Prev by Date: RE: How to get the webservice version inside the webservice code ?
- Next by Date: Re: Vb.net Ms Access Database 2007 Reusable Procedures/queries/functions
- Previous by thread: Re: Vb.net Ms Access Database 2007 Reusable Procedures/queries/functions
- Next by thread: Re: Vb.net Ms Access Database 2007 Reusable Procedures/queries/functions
- Index(es):
Relevant Pages
|