C
chris
Hi,
In my .NET 2005 ASP program, I used system.mdw for opening an MDB file with
permissions and fill 2 gridviews, one with data from MDB and one from users
of MDW. I tried to release the system.mdw from memory, because both files MDB
& MDW should be zipped, but unfortunately MDW is only released when my
program closes, and ZIP file cannot be created. See code below. Is there any
solution ?
--------------------------------------------------------------------------------------------------------
mdsc = New SqlDataSource
mdsc.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
"""" & "C:\test.mdb" & """" & ";Password=aa;User ID=testc;Jet OLEDB:System
database=" & """" & "C:\system.mdw" & """"
mdsc.ProviderName = "System.Data.OleDb"
mdsc.SelectCommandType = SqlDataSourceCommandType.Text
mdsc.SelectCommand = "SELECT company_no, company_name & ' [' & company_no &
']' AS company_name FROM company"
gridview_company.DataSource = mdsc
gridview_company.DataBind()
mdsc.Dispose()
Dim DBEngine As New DAO.DBEngine
Dim db_WKSP As DAO.Workspace
Dim var_group_clients As DAO.Group
Dim var_user As DAO.User
Dim dtbl_info As New Data.DataTable
Dim dcl As Data.DataColumn
Dim drw As Data.DataRow
DBEngine.SystemDB = "C:\system.mdw"
db_WKSP = DBEngine.CreateWorkspace("My_Workspace", "insight_testc", "aa")
var_group_clients = db_WKSP.Groups!Clients
var_group_clients.users.Refresh()
dcl = New Data.DataColumn
dcl.DataType = GetType(String)
dcl.ColumnName = "system_user_name"
dtbl_info.Columns.Add (dcl)
'---------------------------------------------------------------------------------------------------
For Each var_user In var_group_clients.users
drw = dtbl_info.NewRow
drw("system_user_name") = var_user.Name
dtbl_info.Rows.Add (drw)
Next
gridview_mdw_users.DataSource = dtbl_info
gridview_mdw_users.DataBind()
db_WKSP.Close()
In my .NET 2005 ASP program, I used system.mdw for opening an MDB file with
permissions and fill 2 gridviews, one with data from MDB and one from users
of MDW. I tried to release the system.mdw from memory, because both files MDB
& MDW should be zipped, but unfortunately MDW is only released when my
program closes, and ZIP file cannot be created. See code below. Is there any
solution ?
--------------------------------------------------------------------------------------------------------
mdsc = New SqlDataSource
mdsc.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
"""" & "C:\test.mdb" & """" & ";Password=aa;User ID=testc;Jet OLEDB:System
database=" & """" & "C:\system.mdw" & """"
mdsc.ProviderName = "System.Data.OleDb"
mdsc.SelectCommandType = SqlDataSourceCommandType.Text
mdsc.SelectCommand = "SELECT company_no, company_name & ' [' & company_no &
']' AS company_name FROM company"
gridview_company.DataSource = mdsc
gridview_company.DataBind()
mdsc.Dispose()
Dim DBEngine As New DAO.DBEngine
Dim db_WKSP As DAO.Workspace
Dim var_group_clients As DAO.Group
Dim var_user As DAO.User
Dim dtbl_info As New Data.DataTable
Dim dcl As Data.DataColumn
Dim drw As Data.DataRow
DBEngine.SystemDB = "C:\system.mdw"
db_WKSP = DBEngine.CreateWorkspace("My_Workspace", "insight_testc", "aa")
var_group_clients = db_WKSP.Groups!Clients
var_group_clients.users.Refresh()
dcl = New Data.DataColumn
dcl.DataType = GetType(String)
dcl.ColumnName = "system_user_name"
dtbl_info.Columns.Add (dcl)
'---------------------------------------------------------------------------------------------------
For Each var_user In var_group_clients.users
drw = dtbl_info.NewRow
drw("system_user_name") = var_user.Name
dtbl_info.Rows.Add (drw)
Next
gridview_mdw_users.DataSource = dtbl_info
gridview_mdw_users.DataBind()
db_WKSP.Close()