SQLopen

  • Thread starter Thread starter rigoberto perez
  • Start date Start date
R

rigoberto perez

I need use the function SQLopen, but I receive the
message "Sub or function not defined".
Do You now How to set uop microsoft visul basic to allow
use that function?

Thanks
 
Roberto:

There shouldn't be a problem per se. It'd help if you
posted your exact code... but if you define something
like this...My guess is that the function call or the
function signature are different, there may be a
misspelling.


Public Function SQLopen(ByVal SomeParam) as Boolean
'For instance
Dim cn as New SqlConnection(myConnectSTring)
Try
If cn.State <> ConnectionState.Open then cn.Open
Return true
Catch ex as SqlException
Return False
Finally
If cn.State <> COnnectionState.Closed then cn.Close
cn.Dispose ' Or whatever cleanup you want to initiate
End Try


End Function

'Fill in your parameter list and return type as
appropriate.

I have a lot of other code in there just for
illustration, but as long as the call and the signature
match, and they are both in the same module or have
accessible scope, it should work. If the spelling is
correct, is this a method of another class by any
chance? If it's a shared method, have you prefaced the
method call correctly? I suspect one of these is the
problem, but if you post the code, we can probably figure
it out.

Cheers,

Bill


W.G. Ryan
(e-mail address removed)
www.knowdotnet.com
 

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