473,549 Members | 2,570 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Jet engine 4.0 and .Net framework

We recently installed the .Net framework on a windows 2000 server.
Shortly after that we experienced intermitant problems running a web
based program that accesses an Access 2002 database.

The intranet .asp program works, but as soon as it tries to access the
database for normal users, it gives us an "unspecifie d error" and that
it can't access the data base.

As the administrator, I found my access was relatively stable. Anyone
else though gets the errors.

Are there known issues with .NET framework and the Jet engine?

Is there a service patch I could run that may fix this or do I need to
uninstall the .NET and hope things go back to normal?

Thanks.
T.
Nov 17 '05 #1
4 2843
Joe
I'm relatively new to .Net and I'm having similar problems - does restarting
server solve correct the problem? I have another post to this forum looking
for information on this issue and so far it's sitting there unanswered.

I did find some improvement in my situation (error occurred more
intermittently) when I added the iuser_machinena me account in the security
tab of the properties of the c:\documents and settings\machin ename\local
settings\temp folder - apparantly asp.net stores a lot of temporary files
there. This files get cleared on a server restart so I'm thinking the issue
is something to do with these.

I've also read a lot of posts on the Brinkster help forum from users that
experienced this issue - if there are any of those users reading this it
would be great to hear your thoughts and if there has been any progress
resolving the issue there.

Regards,

Joe
"Troy" <ma****@pushorm itchell.com> wrote in message
news:46******** *************** ***@posting.goo gle.com...
We recently installed the .Net framework on a windows 2000 server.
Shortly after that we experienced intermitant problems running a web
based program that accesses an Access 2002 database.

The intranet .asp program works, but as soon as it tries to access the
database for normal users, it gives us an "unspecifie d error" and that
it can't access the data base.

As the administrator, I found my access was relatively stable. Anyone
else though gets the errors.

Are there known issues with .NET framework and the Jet engine?

Is there a service patch I could run that may fix this or do I need to
uninstall the .NET and hope things go back to normal?

Thanks.
T.

Nov 17 '05 #2
I use the Jet engine with the Net v1.0 and 1.1 framework in Win2k server
without any problems.
Where are you getting the "unspecifie d error" ? Or what is reporting such
error? It's not much to go on.

For starters, do have write access writes, virtual and NTFS for the access
mdb file?
--
Peter O'Reilly
Nov 17 '05 #3
Joe
Hi Peter,

Thanks for taking the time to respond.

If it was a permission issue on the database then surely it wouldn't be just
an intermittent error. I'm using Jet 4.0, and can replicate the error using
Access 2000 and Access 2002, win2k server and xp pro.

As for when my error occurs, I've seperated out the data access tier to an
assembly with a number of classes defining a number of functions returning
datasets or datareaders depending on my needs. I am closing all connections
at the end of each function/subroutine in my classes and explicitly
disposing of the returned datareaders/datasets within my business logic
tier.

One thing I have noticed is that the majority of errors occur when I use
forms authentication which uses a couple of tables from the database for
users and their roles. The errors occur in random database transactions so
it's difficult to be more specific. I do have impersonation set to false.

Here's the connection string I'm using:
Provider=Micros oft.Jet.OLEDB.4 .0; Data
Source=c:\inetp ub\wwwroot\site name\resources\ data\data.mdb;J et
OLEDB:Database Password=passwo rd"

and here's the data access assembly code:
(the custusercontrol class simply grabs the connection string from the web
config file)

'############## ####### DLL to store data access classes for site
############### ####

imports system
imports system.data
imports System.Data.Ole Db
imports hypertyper
Namespace HyperTyper
'############## ############### ############### ############### ############### #
##########
'############## # Class to handle mailing list interactions with database
#############
'############## ############### ############### ############### ############### #
##########
public class handle_maillist : inherits custusercontrol
'########## function to check if email address is already in the database
############
public function doesMailExist(B yVal thisemail As String) As Boolean

dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)

Dim queryString As String = "SELECT [mailing_list].* FROM
[mailing_list] WHERE ([mailing_list].[email] = '" & thisemail & "')"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dbParam_email As System.Data.IDa taParameter = New
System.Data.Ole Db.OleDbParamet er
dbParam_email.P arameterName = "@email"
dbParam_email.V alue = thisemail
dbParam_email.D bType = System.Data.DbT ype.String
Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataSet As System.Data.Dat aSet = New System.Data.Dat aSet
dataAdapter.Fil l(dataSet)
dim there as boolean
If dataset.Tables( 0).Rows.Count >0 then
there = true
else
there = false
end if
return there
end function

'############## ########## function to join mailing list
############### ############### ######

public sub joinMaillist(by Val mail_type_id as double, byval firstname as
string, byval surname as string, byval mobile as string, byval email as
string, byval ip as string, byval referrer as string)
Dim dbcomm
dim cusCtl as custusercontrol = new custusercontrol
dim connstr as string = cusCtl.connecti on_string
dim dbconn as New OleDbConnection (connstr)
dbconn.Open()
Dim ds1 as new System.Data.Dat aSet
Dim da1 as New System.Data.Ole Db.OleDbDataAda pter("SELECT * FROM
mailing_list", dbConn)
Dim objCmdBld as New system.data.Ole Db.OleDbCommand Builder(da1)
da1.Fill(ds1, "mailing_li st")

'we go ahead and add email to database

dim myTable1
dim mydatarow1
myTable1 = ds1.tables(0)

myDataRow1 = ds1.tables(0).n ewrow
myDataRow1("dat e_time") = system.DateTime .Now
myDataRow1("fir stname") = firstname
myDataRow1("sur name") = surname
myDataRow1("mob ile") = mobile
myDataRow1("ema il") = email
myDataRow1("cli ent_ip") = ip
myDataRow1("ref ering_page") = referrer
myDataRow1("mai l_type_id") = mail_type_id
myTable1.Rows.A dd(myDataRow1)
da1.Update(myTa ble1)
dbconn.close()
dbconn = nothing
end sub

'############## ##### function to leave the mailing list

public sub leaveMaillist(b yval email as string)
Dim dbcomm
dim cusCtl as custusercontrol = new custusercontrol
dim connstr as string = cusCtl.connecti on_string
dim dbconn as New OleDbConnection (connstr)
dbconn.Open()
Dim objCmdBld as New system.data.Ole Db.OleDbCommand ()
objCmdBld.conne ction = dbconn
objCmdBld.comma ndtext = "delete * FROM mailing_list where email =
'" & email & "'"
objCmdBld.Execu teNonQuery()
dbConn.Close()
dbconn = nothing
end sub

'############## ##### function to return count of specific user groups
############### ###########
public function getMaillistCoun t()
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT count(*) FROM
[mailing_list]"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dataReader
datareader = Convert.ToInt32 (dbCommand.Exec uteScalar().ToS tring())
Return dataReader
dbConnection.Cl ose
dbConnection = nothing
end function

'############## ##### function to return lists of subscribers in different
groups ############### ###########
public function getMaillist(byv al mail_type_id as integer)
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT * FROM [mailing_list]"
if mail_type_id <> 0 then
querystring = querystring & "where mail_type_id = " & mail_type_id
end if
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataSet As System.Data.Dat aSet = New System.Data.Dat aSet
dataAdapter.Fil l(dataSet)
Return dataSet
dbConnection.Cl ose
dbConnection = nothing
end function

'############## ########### function to update a subscriber in the maillist
table ############### ####
public function updateSubscribe r(byVal oldmail as string, firstname as
string, surname as string, email as string, mobile as string)
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "Update [mailing_list] Set
[date_time] = #" & system.datetime .now & "#, [firstname] = '" & firstname &
"', [surname] = '" & surname & "', [email] = '" & email & "', [mobile] = '"
& mobile & "' where email = '" & oldmail & "'"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
dbCommand.execu tenonquery()
dbConnection.cl ose()
dbconnection = nothing
end function
end class

'############## ############### ############### ############### ############### #
###########
'############## # Class to handle user interactions with database
############### #######
'############## ############### ############### ############### ############### #
###########
public class handle_users : inherits CustUserControl
'############## ####### function to get active users for site login
###############

public function authUser(ByVal email As String, ByVal Password As String)
As System.Data.Dat aSet
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)

Dim queryString As String = "SELECT [active_users_vi ew].* FROM
[active_users_vi ew] WHERE (([active_users_vi ew].[email] = @email) AND
([active_users_vi ew].[pas"& _
"sword] = @password))"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dbParam_email As System.Data.IDa taParameter = New
System.Data.Ole Db.OleDbParamet er
dbParam_email.P arameterName = "@email"
dbParam_email.V alue = email
dbParam_email.D bType = System.Data.DbT ype.String
dbCommand.Param eters.Add(dbPar am_email)
Dim dbParam_passwor d As System.Data.IDa taParameter = New
System.Data.Ole Db.OleDbParamet er
dbParam_passwor d.ParameterName = "@password"
dbParam_passwor d.Value = password
dbParam_passwor d.DbType = System.Data.DbT ype.String
dbCommand.Param eters.Add(dbPar am_password)
Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataSet As System.Data.Dat aSet = New System.Data.Dat aSet
dataAdapter.Fil l(dataSet)
Return dataSet
dbconnection.cl ose
dbconnection = nothing
end function

'############## ####### function to get active users details ###############

public function getUserDetails( ByVal email As String) As
System.Data.Dat aSet
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)

Dim queryString As String = "SELECT [active_users_vi ew].* FROM
[active_users_vi ew] WHERE (([active_users_vi ew].[email] = @email))"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dbParam_email As System.Data.IDa taParameter = New
System.Data.Ole Db.OleDbParamet er
dbParam_email.P arameterName = "@email"
dbParam_email.V alue = email
dbParam_email.D bType = System.Data.DbT ype.String
dbCommand.Param eters.Add(dbPar am_email)
Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataSet As System.Data.Dat aSet = New System.Data.Dat aSet
dataAdapter.Fil l(dataSet)
Return dataSet
dbconnection.cl ose
dbconnection = nothing
end function

'############## ####### function to get all users' details ###############

public function getallUsersDeta ils(ByVal email As String) As
System.Data.Dat aSet
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)

Dim queryString As String = "SELECT [all_admin_detai ls_view].*
FROM [all_admin_detai ls_view] WHERE (([all_admin_detai ls_view].[email] =
@email))"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dbParam_email As System.Data.IDa taParameter = New
System.Data.Ole Db.OleDbParamet er
dbParam_email.P arameterName = "@email"
dbParam_email.V alue = email
dbParam_email.D bType = System.Data.DbT ype.String
dbCommand.Param eters.Add(dbPar am_email)
Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataSet As System.Data.Dat aSet = New System.Data.Dat aSet
dataAdapter.Fil l(dataSet)
Return dataSet
dbconnection.cl ose
dbconnection = nothing
end function

'############## ##### function to return count of specific user groups
############### ###########
public function getUserCount(by val usergroup as integer)
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT count(*) FROM [users]
where [users].[user_type_id] =" & usergroup
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dataReader
datareader = Convert.ToInt32 (dbCommand.Exec uteScalar().ToS tring())
Return dataReader
dbConnection.Cl ose
dbConnection = nothing
end function

'############## ##### function to return list of users in specific groups, eg
admin ############### ###########
public function getUserList(byv al usergroup as integer)
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [sorted_user_lis t].* FROM
[sorted_user_lis t] where [sorted_user_lis t].[user_type_id] =" & usergroup
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose
dbConnection = nothing
end function

'############## ##### function to return security role of user
############### ###########
public function getRole(byval email as string)
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [users].* FROM [users]
where [users].[email] ='" & email & "'"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose
dbConnection = nothing
end function

'########## function to check if email address is already in the users
database ############
public function doesUserExist(B yVal thisemail As String) As Boolean

dim cusCtl as custusercontrol = new custusercontrol
dim connectiontring As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)

Dim queryString As String = "SELECT [users].* FROM [users]
WHERE ([users].[email] = '" & thisemail & "')"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dbParam_email As System.Data.IDa taParameter = New
System.Data.Ole Db.OleDbParamet er
dbParam_email.P arameterName = "@email"
dbParam_email.V alue = thisemail
dbParam_email.D bType = System.Data.DbT ype.String
Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataSet As System.Data.Dat aSet = New System.Data.Dat aSet
dataAdapter.Fil l(dataSet)
dim there as boolean
If dataset.Tables( 0).Rows.Count >0 then
there = true
else
there = false
end if
return there
end function

'############## ########### function to add a new user to the users table
############### ####
public function addUser(byVal user_type_id as integer, company as string,
firstname as string, surname as string, card_type_id as integer, card_no as
string, card_security_n o as string, card_exp_mo as integer, card_exp_yr as
integer, password as string, email as string, day_phone as string, eve_phone
as string, mobile as string, fax as string, address1 as string, address2 as
string, address3 as string, city as string, postcode as string, county_id as
integer, country_id as integer, url as string, admin_level_id as integer,
active as integer, registered as integer)
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "Insert into users([user_type_id],
[company], [firstname], [surname], [card_type_id], [card_no],
[card_security_n o], [card_exp_mo], [card_exp_yr], [password], [email],
[day_phone], [eve_phone], [mobile], [fax], [address1], [address2],
[address3], [city], [postcode], [county_id], [country_id], [url],
[admin_level_id], [active], [registered]) values (" & user_type_id & ", '" &
company & "', '" & firstname & "', '" & surname & "', " & card_type_id & ",
'" & card_no & "', '"& card_security_n o & "', " & card_exp_mo & ", " &
card_exp_yr & ", '" & password & "', '" & email & "', '" & day_phone & "',
'" & eve_phone & "', '" & mobile & "', '" & fax & "', '" & address1 & "', '"
& address2 & "', '" & address3 & "', '" & city & "', '" & postcode & "', " &
county_id & ", " & country_id & ", '" & url & "', " & admin_level_id & ", "
& active & ", " & registered & ")"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
dbCommand.execu tenonquery()
dbConnection.cl ose()
dbconnection = nothing
end function

'############## ########### function to update a user to the users in the
users table ############### ####
public function updateUser(byVa l user_type_id as integer, company as string,
firstname as string, surname as string, card_type_id as integer, card_no as
string, card_security_n o as string, card_exp_mo as integer, card_exp_yr as
integer, password as string, email as string, day_phone as string, eve_phone
as string, mobile as string, fax as string, address1 as string, address2 as
string, address3 as string, city as string, postcode as string, county_id as
integer, country_id as integer, url as string, admin_level_id as integer,
active as integer, registered as integer)
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "Update [users] Set [user_type_id]
= " & user_type_id & ", [company] = '" & company & "', [firstname] = '" &
firstname & "', [surname] = '" & surname & "', [card_type_id] = " &
card_type_id & ", [card_no] = '" & card_no & "', [card_security_n o] ='" &
card_security_n o & "', [card_exp_mo] =" & card_exp_mo & ", [card_exp_yr] = "
& card_exp_yr & ", [password] = '" & password & "', [email] = '" & email &
"', [day_phone] = '" & day_phone & "', [eve_phone] = '" & eve_phone & "',
[mobile] = '" & mobile & "', [fax] = '" & fax & "', [address1] = '" &
address1 & "', [address2] = '" & address2 & "', [address3] = '" & address3 &
"', [city] = '" & city & "', [postcode] = '" & postcode & "', [county_id] =
" & county_id & ", [country_id] = " & country_id & ", [url] = '" & url & "',
[admin_level_id] = " & admin_level_id & ", [active] =" & active & ",
[registered] =" & registered
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
dbCommand.execu tenonquery()
dbConnection.cl ose()
dbconnection = nothing
end function
'############## ########### function to delete a user from the users table
based on user_id_type ############### ####
public sub deleteUser(byVa l email as string)
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "DELETE * FROM users where email =
'" & email & "'"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
dbCommand.execu tenonquery()
dbConnection.cl ose()
dbconnection = nothing

end sub

end class

'############## ############### ############### ############### ############### #
#######
'############## ##### Class to handle products interaction
############### ##########
'############## ############### ############### ############### ############### #
#######

Public class handle_products
public function getProdTypes()
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [product_type].* FROM
[product_type]"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection
Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose
dbConnection = nothing
end function

'############## ####### function to get product categories by product type
###############

public function getProdCatsByTy pe(ByVal prodType As integer)
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [product_cats].* FROM
[product_cats] WHERE [product_cats].[prod_type_id] =" & prodType & ";"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose()
dbConnection = nothing
end function

end class

'############## ############### ############### ############### ############### #
############### #
'############## ######## Class with utility functions for database editing
############### ###
'############## ############### ############### ############### ############### #
############### #

public class handle_db

'############## ######## function to return the list of ALL countries from
the database #####
function getAllCountries
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [countries].* FROM
[countries]"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose()
dbConnection = nothing
end function

'############## ####### function to return list of active countries
############### ##########
function getActiveCountr ies
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [active_countrie s_view].*
FROM [active_countrie s_view]"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose()
dbConnection = nothing
end function

'############## ######## function to return the list of ALL counties from the
database #####
function getAllCounties
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [counties].* FROM
[counties]"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose()
dbConnection = nothing
end function

'############## ####### function to return list of active countries
############### ##########
function getActiveCounti es
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [active_counties _view].*
FROM [active_counties _view]"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose()
dbConnection = nothing
end function

'############## ####### function to return list of user_types
############### ##########
function getUserTypes
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [user_type].* FROM
[user_type]"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose()
dbConnection = nothing
end function

'############## ####### function to return list of admin_levels
############### ##########
function getAdminLevels
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [admin_levels].* FROM
[admin_levels]"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose()
dbConnection = nothing
end function

'############## ######## function to return the list of mailing list
subscriber types from the database #####
function getMailTypes
dim cusCtl as custusercontrol = new custusercontrol
dim connectionStrin g As String = cusCtl.connecti on_string

Dim dbConnection As System.Data.IDb Connection = New
System.Data.Ole Db.OleDbConnect ion(connectionS tring)
dbConnection.op en()
Dim queryString As String = "SELECT [mail_type].* FROM
[mail_type]"
Dim dbCommand As System.Data.IDb Command = New
System.Data.Ole Db.OleDbCommand
dbCommand.Comma ndText = queryString
dbCommand.Conne ction = dbConnection

Dim dataAdapter As System.Data.IDb DataAdapter = New
System.Data.Ole Db.OleDbDataAda pter
dataAdapter.Sel ectCommand = dbCommand
Dim dataReader
datareader = dbcommand.execu teReader()
Return dataReader
dbConnection.Cl ose()
dbConnection = nothing
end function
end class
end namespace

Is there something really obvious here I'm overlooking - as I mentioned in
my previous message, I am a asp.net newbie.

Regards,

Joe


"Peter O'Reilly" <Pe***********@ timeinc.com!N!O !.S!P!AM!> wrote in message
news:uX******** ******@TK2MSFTN GP12.phx.gbl...
I use the Jet engine with the Net v1.0 and 1.1 framework in Win2k server
without any problems.
Where are you getting the "unspecifie d error" ? Or what is reporting such
error? It's not much to go on.

For starters, do have write access writes, virtual and NTFS for the access
mdb file?
--
Peter O'Reilly

Nov 18 '05 #4
Joe,

My recommendation to you is to use structured exception handling present in
VB.NET. I highly recommend using this language feature.

I recommend writing code to dump the exception's text into a log file in the
catch statement. From there you will be able to pin-point the error. It's
definitely worth the time invested to implement, which is really not much in
light of the time troubleshooting errors after they occur.

Likewise, I would have the database connection closing and destruction
performed in the finally statement to ensure that it does in fact close
during normal operation or a run time error. Ensuring db connections,
particularly for file based MS Access, is most important and now with
structured exception handling being included with VB, to that end it is of
great fail-safe benefit.

Good luck.

--
Peter O'Reilly
Nov 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2633
by: PeterH | last post by:
I have an application written in VB.Net that opens an Access database (ie a Microsoft Jet 4 database mdb file). It does not use Access forms or reports, so there is no need for users to have Access itself. I have two questions. 1) Must my users must have the Jet 4 database engine? Or is its functionality contained in the .Net Framework?...
5
2893
by: David | last post by:
Is the Access Data Engine part of the VS/.net install. Eg. I need to write a stand alone Form app for which a small DB would be helpful. IN VB 6, I would use ADO to call the Access engine. I know that OLE is part of C# v1.1,but does MS ship the single engine as part of the install? If not, can I download it and install it? If yes, what...
0
877
by: Harry Simpson | last post by:
I've got an 1.0 App (VS2002) that uses Crystal Reports engine (4 merge modules). I need to install the app on a domain server and you know that's a problem. Has anyone had success running 1.0 App with crystal on 1.1 Framework (1.0 Framework uninstalled first)???? I tried this on a fresh Windows 2003 box and the web ran ok but the crystal...
0
1444
by: raf_z | last post by:
Hi, I think i'm doing something simple, although i may be wrong. I was able to load a Crystal report file up until today, and even now, its only 1 report that's misbehaving. I'll confess that i didn't create the report, it was done by our Crystal guy with Crystal 9 (or 8), all i do is load it using .NET, which, like i said before, worked...
4
5686
by: ali.jan | last post by:
Hi, It is trivial to load an assembly in a new Application Domain. Is there any way of loading an assembly in a new process? I tried using the Process class like this: Process p = new Process() p.StartInfo.FileName = mStartupFile p.StartInfo.UseShellExecute = False
8
2405
by: Jay Balapa | last post by:
This am I posted the following message thinking there was a problem with Dot Net Framework 2.0. But problem occurs only with Dot Net 2.0 and IIS 6.0 installed machines. I tested this on my laptop running 5.1 and Framework 2.0 and runs perfectly fine. Can anyone from Microsoft help me. I have all our ASP.Net applications converted 2.0 and...
9
1487
by: Jacky | last post by:
Hi all, I just started learning Python and would like to starting writing some web-based applications with Python. I did have pretty much experience with doing so with PHP and Java, but Python seems a bit different for me. Do you guys have some good web framework to recommend? (I don't want to use CGI mode)
8
2115
by: Bruno Rafael Moreira de Barros | last post by:
I have this framework I'm building in PHP, and it has Search Engine Friendly URLs, with site.com/controller/page/args... And on my View files, I have <?=$this->baseURL;?to print the base URL on the links (eg. <a href='<?=$this->baseURL;?>/controller/page/args'>Go somewhere</ a>. But on the CSS / JS files, how will I do it? I wonder, because on...
11
5812
by: Grzegorz Staniak | last post by:
Hi, In a couple of weeks I'm starting a medium-size project (using a web framework) involving a workflow implementation. Are you aware of any open source workflow engines/libraries that I could base the project on? Google returns hist for GoFlow (Django only, from what I can tell), itools.workflow, spiff (AFAIK tied to a CMS), but not much...
1
2888
theseoworld
by: theseoworld | last post by:
Hi, Which the best Javascript framework for Google App Engine for big project with python? and with web 2.0 and UI Design aspects and easy custimiization of the code and good documentation If you have used Google App Engine or not please mention that ?
0
7526
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7965
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7817
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3504
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3487
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1949
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1063
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
771
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.