Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 1.51 KB | None | 0 0
  1. <%
  2. if request.QueryString("OPE") = "W" then
  3.    
  4.     on error resume next
  5.    
  6.     ' PERCORSO DEL DATABASE
  7.     url_DB = "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/dbpesca.mdb")
  8.    
  9.     Set Conn = Server.CreateObject("ADODB.Connection")
  10.     conn.Open url_DB
  11.    
  12.     Set RS = Server.CreateObject("ADODB.Recordset")
  13.     SQL = "SELECT * FROM coordinate"
  14.     RS.Open SQL, conn, adOpenStatic, adLockOptimistic
  15.    
  16.     RS("X") = request.QueryString("X")
  17.     RS("Y") = request.QueryString("Y")
  18.    
  19.     RS.Update
  20.    
  21.     RS.Close
  22.    
  23.     conn.Close
  24.    
  25.     set RS = nothing
  26.     set conn = nothing
  27.    
  28.     if err.number <> 0 then response.Write(Err.Description + " ----> " + Err.Source) else response.Write("OK, stai muovendo.")
  29.  
  30. elseif request.QueryString("OPE") = "R" then
  31.  
  32.     on error resume next
  33.    
  34.     ' PERCORSO DEL DATABASE
  35.     url_DB = "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/dbpesca.mdb")
  36.    
  37.     Set Conn = Server.CreateObject("ADODB.Connection")
  38.     conn.Open url_DB
  39.    
  40.     Set RS = Server.CreateObject("ADODB.Recordset")
  41.     SQL = "SELECT * FROM coordinate"
  42.     RS.Open SQL, conn, adOpenStatic, adLockReadOnly
  43.    
  44.     X = trim(cstr(RS("X")))
  45.     Y = trim(cstr(RS("Y")))
  46.    
  47.     RS.Close
  48.    
  49.     conn.Close
  50.    
  51.     set RS = nothing
  52.     set conn = nothing
  53.    
  54.     c = ""
  55.    
  56.     for i = len(X) to 9
  57.         c = c + "0"
  58.     next
  59.    
  60.     c = c + X
  61.    
  62.     for i = len(Y) to 9
  63.         c = c + "0"
  64.     next
  65.    
  66.     c = c + Y
  67.    
  68.     if err.number <> 0 then
  69.         response.Write(Err.Description + " ----> " + Err.Source)
  70.     else
  71.         response.Write(c)
  72.     end if
  73.    
  74.  
  75. end if
  76.  
  77. %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement