azizalm Posted February 5, 2006 Share Posted February 5, 2006 this cauld is make troubles.Private dbread Private con As OdbcConnection Private comm As OdbcCommand 'function for opening connection and geting query result Function initConnection(ByVal sql As String) ' make sure every thing is closed On Error Resume Next comm = Nothing con.Close() con = Nothing On Error GoTo 0 'open the connection Dim conn As New Connections con = New OdbcConnection(conn.get_dsn()) con.Open() 'execute th sql and assign value to dbread comm = New OdbcCommand(sql, con) dbread = comm.ExecuteReader() Return dbread End Function 'function to close a connection that opened in previos function Function closeConnection() 'after using connection by the initconnection() function the 'closeconnection is the 'function that deal with closeing connection and odbcommand Try comm = Nothing 'set the odbcommand as nothing con.Close() 'close the odbconnections con = Nothing 'set the odbconnection as Nothing Catch ex As Exception End Try End Function '******************************************************************************** Link to comment Share on other sites More sharing options...
aspnetguy Posted February 6, 2006 Share Posted February 6, 2006 what troubles??? what error messages do you get...you need to be very specific. You won't get many people to help if you make them work hard just to discover what your question is. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now