Using User-defined Functions in VB.net

  • Thread starter SemiNoviceProgramer
  • Start date
S

SemiNoviceProgramer

Hi Every body

I used access succefully for years and I created many scientefic
databases with it

Now I want to use VB.net2005 environmment with access database

I succesfuly loaded my database BUT all the custom functions in the
modules had not been imported

So I created a module in VB.net and put all my custom functions as
Public Functions,
But this fails too!

What Can I Do to make the SQL engine read functions as it was in
access?

Thanks in advance
 
L

Larry Linson

a) Access MDB is for retards

b) SQL Server UDFs are great

c) if you're trying to reuse them in VB 2005 you'll have to rewrite
them _AGAIN_

MS does not support code reuse; move away from VB; consider PHP or
something
MS has demonstrated; time and time again-- that they could care less
about 7 million vb6 programmers; and they'd rather cater to a couple
hundred C# _FAGS_
 
L

Larry Linson

either learn SQL or VB you can't skate by without one of the two


I personally said 'screw dotnet' and i've been focused on SQL for the
past 5 years; I love it

and worse comes to worse; i'll move to mySql or Oracle or someting; MS
has demonstrated a complete and utter disregard for programmers,
programmers, programmers
 
R

RobinS

If nobody here helps you (and ignore the Larry Linson guy; he's trolling),
I recommend that you post this to the
microsoft.public.sqlserver.programming newsgroup.

Robin S.
 
P

pfc_sadr

seriously robin

time to start sticking on topic


DOTNET DOES NOT SUPPORT CODE REUSE

IT DOES NOT SUPPORT VBA
IT DOES NOT REPLACE VBA

IT DOES NOT SUPPORT VBS
IT DOES NOT REPLACE VBS

keep your access code in MS Access where it belongs

DOTNET IS DEAD
AND NO ONE CARES

IF THERE WAS A HELL
I WOULD SEND MICROSOFT THERE
 
B

Branco Medeiros

SemiNoviceProgramer said:
I used access succefully for years and I created many scientefic
databases with it

Now I want to use VB.net2005 environmment with access database

I succesfuly loaded my database BUT all the custom functions in the
modules had not been imported
<snip>

There's a really long time since I coded in Access, so forgive any
mistakes.

It seems to me that the Access functions belong to the DB, and will
probably not be imported.

A (somewhat far fetched) solution would be to create (parameterized)
queries that use your functions in Access and import the queries into
VB.

HTH.

Regards,

Branco.
 
L

Larry Linson

learn how to rewrite VBA into DOTNET

_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
_WELCOME_TO_VISUAL_FRED_
 
L

Larry Linson

and for the record, the mix-match of VBA and SQL is something that is
only available in MS Access

it isn't anywhere else


sorry
 
C

Cor Ligthert [MVP]

Semi

There should be almost no differences. OleDB is more difficult to use with
an auto identifier because the created one is not given back. Parameters in
OleDB have to be given in sequence as the are created.

I write OleDB that is because MS-Access has no SQLClient provider. Using
edit and replace will be probably the most you have to do.

Cor
 
S

SemiNoviceProgramer

Thanks Every body for reply

To Robins
I loaded the tabels and queries only to VB2005
The code and parameters' queries did not load

I have no problem to rewrite code in VB.net syntax

BUT the problem is that VB.net is unable to link its code to the
database

for example it loaded a table, say emploee table, a query should be
built to geather those having 3 years or more and to raise there
salary according to specific function NewSalary(DateOfStart,
BasicSalary, PositionID)
This was done in Access by simply definig Public function in a module
and every thing ok
When I defined a public function in VB.net, the query can not identify
that function and returns an error.
In SQL server the stored procedures fixed the problem but in access
database no stored procedures.

Is there any possible solution?
 
A

Armin Zingler

SemiNoviceProgramer said:
Thanks Every body for reply

To Robins
I loaded the tabels and queries only to VB2005
The code and parameters' queries did not load

I have no problem to rewrite code in VB.net syntax

BUT the problem is that VB.net is unable to link its code to the
database

for example it loaded a table, say emploee table, a query should be
built to geather those having 3 years or more and to raise there
salary according to specific function NewSalary(DateOfStart,
BasicSalary, PositionID)
This was done in Access by simply definig Public function in a
module and every thing ok
When I defined a public function in VB.net, the query can not
identify that function and returns an error.
In SQL server the stored procedures fixed the problem but in access
database no stored procedures.

Is there any possible solution?


Modules <> Database

means: In VB.Net, you are doing database programming, not Access
programming. Access uses the same database enginge (Jet) as VB.Net does, but
VB.Net does not use Access. You do not even have to have Access installed on
a machine running your application, only the Jet is necessary. Modules (like
Reports) belong to Access. The Jet does not know any of your code in VB.Net.
That's database programming.

If you want to do more than SQL can offer, write the code in VB.Net. Or, if
you like to have it in the database (I don't), SQL server (express) using
it's stored procedures may be an alternative.


Armin
 
L

Larry Linson

Access MDB can do this; and I think that ColdFusion can do this?? i
don't know why I say that I just think that is true about coldfusion.

but no, visual basic .NET doesn't support _ANYTHING_ considered
practical like this.

you can't bind a sql statement to a form; nothign like this.

sorry; I hate vb.net and this is one of those reasons

but you've just got to do it programmatically
and because the forms and all classes and they're all optimized for a
MDI: i don't even think that you can refer to the form name.

instead of DoCmd.OpenForm

you've got to do this:

Dim StartupForm1 as new StartupForm
StartupForm1.Show

and then when you're living on the Detail form, in order to refer to a
control on the StartupForm; you need to make sure that you use the
StartupForm1.txtUsername instead of StartupForm.txtUsername

these people are going to flame me; but I believe that I'm on the
right track here.
I just think that VB dotnet is not competitive with MS Access in 10%
of the functionalty; I would reccomend avoiding VB.net and maybe it
will be a decent product with the next release (i know; I've been
saying that for 5 years but the damn IDE crashes every day and it's
thus unusable)
 
L

Larry Linson

Armin;

so sissy-pants; why are u scared of the database side?

oh does the little baby vb.net progwammer not speak SQL roflmao

I swear to ****in god if you kids stoppped ****ign around with UML and
classes and all that crap-- and you started focusing ON THE DATABASE
then maybe these jobs would stop getting outsourced to India.

I MEAN SERIOUSLY.

In vb6; 95% of applications either write stuff into a database or pull
it out of a database; or both.

you lazy retarded kids don't understand that collections and classes
have NO ADVANTAGE to a database and life is a lot easier when you make
the database the center of your app.

Seriously.

Any kid that uses classes instead of a database is ****ing stupid.

-Larry Linson Jr
(WAKE UP DAD, LEARN SQL!)
 
L

Larry Linson Jr

Hi Dad!

Larry Linson said:
Access MDB can do this; and I think that ColdFusion can do this?? i
don't know why I say that I just think that is true about coldfusion.

but no, visual basic .NET doesn't support _ANYTHING_ considered
practical like this.

you can't bind a sql statement to a form; nothign like this.

sorry; I hate vb.net and this is one of those reasons

but you've just got to do it programmatically
and because the forms and all classes and they're all optimized for a
MDI: i don't even think that you can refer to the form name.

instead of DoCmd.OpenForm

you've got to do this:

Dim StartupForm1 as new StartupForm
StartupForm1.Show

and then when you're living on the Detail form, in order to refer to a
control on the StartupForm; you need to make sure that you use the
StartupForm1.txtUsername instead of StartupForm.txtUsername

these people are going to flame me; but I believe that I'm on the
right track here.
I just think that VB dotnet is not competitive with MS Access in 10%
of the functionalty; I would reccomend avoiding VB.net and maybe it
will be a decent product with the next release (i know; I've been
saying that for 5 years but the damn IDE crashes every day and it's
thus unusable)
 

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

Top