Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

ASP - DB ReadOnly zasto?

[es] :: Visual Basic 6 :: ASP - DB ReadOnly zasto?

[ Pregleda: 4937 | Odgovora: 8 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

webgirl

Član broj: 33724
Poruke: 30
*.credybanka.com



Profil

icon ASP - DB ReadOnly zasto?08.09.2004. u 12:36 - pre 238 meseci
Zašto mi javlja da je baza ReadOnly?

Code:

<%
    Dim DB
    Set DB = Server.CreateObject ("ADODB.Connection")
    DB.Mode = adModeReadWrite
    DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=c:\inetpub\wwwroot\asp_test\studenti.mdb")

    SQLStmt = "INSERT into students(StudentsID,FirstName,LastName,Birthdate,EmailAddress)"
    SQLstmt = SQLstmt & " VALUES ("
    SQLstmt = SQLstmt & "'100', 'aaa','bbb','20.6.1999','[email protected]')"
    Set RS = DB.execute(SQLstmt)    
    
    RS.Close
    DB.Close
%>


ili sledeće:

Code:

<%        
    Dim DB
    Set DB = Server.CreateObject ("ADODB.Connection")
    DB.Mode = adModeReadWrite
    DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=c:\inetpub\wwwroot\asp_test\studenti.mdb")
        
    Dim RS
    Set RS = Server.CreateObject ("ADODB.Recordset")
    RS.Open "Students", DB, adOpenStatic, adLockOptimistic
    
    RS.AddNew
        RS ("FirstName") = "Manas"
        RS ("LastName") = "Tungare"
        RS ("EmailAddress") = "[email protected]"
        RS ("Birthdate") = CDate("19.7.1977")
    RS.Update
    
    RS.Close
    DB.Close
%>


 
Odgovor na temu

mladenovicz
Zeljko Mladenovic
Xoran Technologies, Inc., Ann Arbor, MI,
USA / Software Engineer
Ann Arbor, MI, USA

Član broj: 6598
Poruke: 2065
*.bg.wifi.vline.verat.net

Jabber: mladenovicz@elitesecurity.org
ICQ: 95144142
Sajt: yubc.net/~mz


Profil

icon Re: ASP - DB ReadOnly zasto?08.09.2004. u 12:46 - pre 238 meseci
Verovatno je problem sa permissionima. User koji se zove IUSR_ImeMasine treba da ima full pristup folderu gde se baza nalazi.

Takodje, mislim da ASP ne prepoznaje ove konstante

Code:

RS.Open "Students", DB, adOpenStatic, adLockOptimistic


Moras i ili definistai u ASPu ili korisiti cifre, npr.

Code:

adoRS.Open Qry, adoConn, 1, 3


 
Odgovor na temu

webgirl

Član broj: 33724
Poruke: 30
*.credybanka.com



Profil

icon Re: ASP - DB ReadOnly zasto?08.09.2004. u 12:54 - pre 238 meseci
Pa znas kako meni ceo ovaj folder koji vidis u putanji nije ni sharovan, a posto sam u mrezi prilazim kao:

http://IP adresa/asp_test/

i to je to to se lepo vidi. Read podataka iz baze radi ali ovo ostalo nema šansi
Sve mislim da IIS nisam nesto dobro podesila mada sam i tamo stavila checkirane opcije i Read i Write.

Nije mi jasno ne znam sta da radim
 
Odgovor na temu

mladenovicz
Zeljko Mladenovic
Xoran Technologies, Inc., Ann Arbor, MI,
USA / Software Engineer
Ann Arbor, MI, USA

Član broj: 6598
Poruke: 2065
*.bg.wifi.vline.verat.net

Jabber: mladenovicz@elitesecurity.org
ICQ: 95144142
Sajt: yubc.net/~mz


Profil

icon Re: ASP - DB ReadOnly zasto?08.09.2004. u 13:01 - pre 238 meseci
Ne mora da bude shareovan.

1. Otvoris Windows Explorer
2. dodjes do foldera c:\inetpub\wwwroot\
3. selktujes asp_test folder
4. desni klik, pa properties
5. Odaberi security tab

Ovde su definisani permissioni za taj folder. Ako tu u listi usera za koje su definisani permissioni nema usera koji se zove IUSR_ImeMasine, dodaj ga i daj mu full pristup
 
Odgovor na temu

webgirl

Član broj: 33724
Poruke: 30
*.credybanka.com



Profil

icon Re: ASP - DB ReadOnly zasto?08.09.2004. u 13:11 - pre 238 meseci
neće ni to probala sam :-(
 
Odgovor na temu

mladenovicz
Zeljko Mladenovic
Xoran Technologies, Inc., Ann Arbor, MI,
USA / Software Engineer
Ann Arbor, MI, USA

Član broj: 6598
Poruke: 2065
*.bg.wifi.vline.verat.net

Jabber: mladenovicz@elitesecurity.org
ICQ: 95144142
Sajt: yubc.net/~mz


Profil

icon Re: ASP - DB ReadOnly zasto?08.09.2004. u 13:27 - pre 238 meseci
Ajde pasteuj koja se tacno greska javlja

Takodje, izbaci ovu liniju

Code:

DB.Mode = adModeReadWrite

 
Odgovor na temu

webgirl

Član broj: 33724
Poruke: 30
*.credybanka.com



Profil

icon Re: ASP - DB ReadOnly zasto?08.09.2004. u 13:34 - pre 238 meseci
Za :
Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<!-- #INCLUDE file="adovbs.inc"-->
<%        
    Dim DB
    Set DB = Server.CreateObject ("ADODB.Connection")

    DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=c:\inetpub\wwwroot\asp_test\studenti.mdb")
        
    Dim RS
    Set RS = Server.CreateObject ("ADODB.Recordset")
    RS.Open "Students", DB, adOpenStatic, adLockOptimistic
    
    RS.AddNew
        RS ("FirstName") = "aaa"
        RS ("LastName") = "bbb"
        RS ("EmailAddress") = "[email protected]"
        RS ("Birthdate") = CDate("19.7.1977")
    RS.Update
    
    RS.Close
    DB.Close
%>
</body>
</html>

greska je:

Technical Information (for support personnel)

Error Type:
Microsoft JET Database Engine (0x80040E09)
Cannot update. Database or object is read-only.
/asp_test/tabela_insert.asp, line 20

-----------------------------------

a za:
Code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
    Dim DB
    Set DB = Server.CreateObject ("ADODB.Connection")
    
    DB.Open ("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=c:\inetpub\wwwroot\asp_test\studenti.mdb")

    SQLStmt = "INSERT into students(StudentsID,FirstName,LastName,Birthdate,EmailAddress)"
    SQLstmt = SQLstmt & " VALUES ("
    SQLstmt = SQLstmt & "'100', 'aaa','bbb','20.6.1999','[email protected]')"
    Set RS = DB.execute(SQLstmt)    
    
    RS.Close
    DB.Close
%>
</body>
</html>

greska je :

Technical Information (for support personnel)

Error Type:
Microsoft JET Database Engine (0x80004005)
Operation must use an updateable query.
/asp_test/tabela_insert1.asp, line 19
 
Odgovor na temu

mladenovicz
Zeljko Mladenovic
Xoran Technologies, Inc., Ann Arbor, MI,
USA / Software Engineer
Ann Arbor, MI, USA

Član broj: 6598
Poruke: 2065
*.bg.wifi.vline.verat.net

Jabber: mladenovicz@elitesecurity.org
ICQ: 95144142
Sajt: yubc.net/~mz


Profil

icon Re: ASP - DB ReadOnly zasto?08.09.2004. u 13:47 - pre 238 meseci
Ovo je 100% problem sa permissionima.
Pogledaj ovo i proveri da li si podesila sve kako treba

Takodje , ovo

Code:

RS.Open "Students", DB, adOpenStatic, adLockOptimistic


probaj da zamenis sa

Code:

RS.Open "SELECT * FROM Students WHERE False", DB, 1, 3


Offtopic:

ovde

Code:

    RS.Close
    DB.Close


ti nedostaje

Code:

    Set RS = Nothing
    Set DB = Nothing


Ako je BirthDate definisano kao Date u bazi, onda ovo:
Code:

'20.6.1999'


treba da izgleda ovako
Code:

#20.6.1999#


Ako je StudentsID broj onda ne treba '100' nego 100. Stringovi idu unutar '', a date vrednosti unutar ##. Ako je StudentID autonumber onda ne prosledjujes vrednost. Zbog ovoga je zgodnije koristiti recordset objekat
 
Odgovor na temu

webgirl

Član broj: 33724
Poruke: 30
*.credybanka.com



Profil

icon Re: ASP - DB ReadOnly zasto?09.09.2004. u 09:26 - pre 238 meseci
Ćao

kada si mi napisao ono prvo uputstvo oko usera IUSR_ImeMasine,
nisam znala sta je taj user pa sam sebi dodeljivala pravo (moracu da ucim i posao administratora ne vredi :-)) , ali sad sam to ponovo pokusala kad sam procitala ovo uputstvo i pronasla ga i RADI !

Hvala ti puno.
 
Odgovor na temu

[es] :: Visual Basic 6 :: ASP - DB ReadOnly zasto?

[ Pregleda: 4937 | Odgovora: 8 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.