Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to insert with ASP
Message
De
05/07/2007 17:54:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
05/07/2007 16:16:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Divers
Thread ID:
01237206
Message ID:
01238123
Vues:
14
>>>Given the following code:
>>>
>>>< %
>>>Set oConn = Server.CreateObject("ADODB.Connection")
>>>ConnStr = "Driver=Microsoft Visual Foxpro Driver; UID=userID;SourceType=DBC;SourceDB=G:\INetPAG\TIPApplication\RegionalBids\Data\bidsdata.dbc"
>>>oConn.Open ConnStr
>>>
>>>lcUser = trim(request.form("user"))
>>>lcPassword = trim(request.form("password"))
>>>lnAuthlevel = -1
>>>
>>>if lcUser <> "" and lcPassword <> "" then
>>>   sql = "select * from users where username = '" & lcUser & "' and password = '" & lcPassword & "'"
>>>   Set oUser = oConn.Execute(sql)
>>>   lnAuthlevel = cdbl(oUser("authorization"))
>>>   session("authlevel") = lnAuthlevel
>>>end if
>>>
>>>if lcUser <> "" then
>>>if lnAuthlevel > 0 then
>>>     sql = "insert into xlogins (username) values ('Test')"
>>>     set oLogin = oConn.Execute(sql)     && it fails here
>>>end if
>>>end if
>>>% >
>>>
>>>reading and verifying the login works fine. But the attempt to record the login into the xlogins table results in an error that says 'unable to update the cursor'. Am I missing something simple or is there another technique needed here?
>>>
>>>Thanks
>>
>>It's a security issue. You don't have write access to data.
>>
>>Also I suggest VFPOLEDB driver instead of ODBC driver:
>>
>>
>>Set oConn = Server.CreateObject("ADODB.Connection")
>>ConnStr = "Provider=VFPOLEDB;" & _
>> "Data Source=G:\INetPAG\TIPApplication\RegionalBids\Data\bidsdata.dbc"
>>
Cetin
>
>Cetin -
>I swapped your code for mine. It still works the same. I DO have write access to the data via VFP if I open it in the development environment. Is there something special I need to do in the asp page to open it for write access?
>
>- Don

Security as I said before. VFP runs in the context of local account. But ASP runs with a guest account (IUSR_machinename). If G: is remote then it makes things more complicated. That machine then should trust this one's IUSR account.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform