powered by simpleCommunicator - 2.0.59     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / Доступ к акцесовской базе
2 сообщений из 2, страница 1 из 1
Доступ к акцесовской базе
    #33416055
dragon_rider
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Вот код обработчика нажатия кнопки
После его прохождения постоянно появляется ошибка "Невозможно использовать ''; файл уже используется"
Просьба не кидать камнями я новичок 8-)
Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
56.
57.
58.
59.
Sub SubmitBtn_Click(Sender As Object, E As EventArgs)
    Dim DBConn as OleDbConnection
    Dim DBInsert As New OleDbCommand
    Dim DBCommand As OleDbDataAdapter
    Dim DSPageData as New DataSet
    Dim CurrentQuantity as Integer
    Dim CurrentPrice as Single
    Dim CurrentShipping as Single
    Dim CurrentProductName as String
    DBConn = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;" _
        & "DATA SOURCE=" & Server.MapPath("./base.mdb;"))
		
		DBInsert.Connection = DBConn
		DBInsert.Connection.Open
		
    If Len(Session("CustomerID")) =  0  Then    
		
        DBInsert.CommandText = "Insert Into Customers " _
            & "(Status, DateEntered) values ('Shopping', '" _
            & Now() & "')"
			
		DBInsert.ExecuteNonQuery()
		DBInsert.Connection.close
        DBCommand = New OleDbDataAdapter _
            ("Select Max(CustomerID) as MaxID " _
            & "From Customers", DBConn) 
        DBCommand.Fill(DSPageData, _
            "CustomerID")
        Session("CustomerID") = DSPageData.Tables("CustomerID"). _
            Rows( 0 ).Item("MaxID")
    End If
	
    DBCommand = New OleDbDataAdapter _
        ("Select ProductName, ShippingCharge, " _
        & "Price From Products Where " _
        & "ProductID = " & Request.QueryString("ProductID") _
        , DBConn) 
    DBCommand.Fill(DSPageData, _
        "ProductData")
    CurrentQuantity = txtQuantity.Text
    CurrentPrice = CurrentQuantity * _
        DSPageData.Tables("ProductData"). _
        Rows( 0 ).Item("Price")
    CurrentShipping = CurrentQuantity * _
        DSPageData.Tables("ProductData"). _
        Rows( 0 ).Item("ShippingCharge")
    CurrentProductName = DSPageData.Tables("ProductData"). _
        Rows( 0 ).Item("ProductName")
	
    DBInsert.CommandText = "Insert Into ShoppingCartItems " _
        & "(CustomerID, ProductName, Quantity, Price, Shipping) " _
        & "values (" _
        & Session("CustomerID") & ", " _
        & "'" & CurrentProductName & "', " _
        & CurrentQuantity & ", " _
        & CurrentPrice & ", " _
        & CurrentShipping & ")"
		DBInsert.Connection.close
    Response.Redirect("./check_out.aspx")
End Sub
...
Рейтинг: 0 / 0
Доступ к акцесовской базе
    #33416521
RFT
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / ASP.NET [игнор отключен] [закрыт для гостей] / Доступ к акцесовской базе
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]