asp'de veri tabanı kodları yardım

salzey
07-07-2008, 14:12   |  #1  
OP Taze Üye
Teşekkür Sayısı: 0
10 mesaj
Kayıt Tarihi:Kayıt: Mar 2007

aşağıdaki sql kodlarının nasıl çalıştığını, ne işe yaradığını, tablo üzerinde ne gibi değişiklikler yaptığını bu işten anlayan arkadaşlarım anlatırlarsa çok sevinirim...
----upload.asp---
<!--#INCLUDE FILE="admin_connections.asp"-->
<!--#INCLUDE FILE="pagesettings.asp"-->
<%
Set Upload = Server.CreateObject("Persits.Upload")
Upload.Save
Upload.SetMaxSize 100000, True
Set File1 = Upload.Files("StrImageMini")
Set File2 = Upload.Files("StrImage")
File1.SaveAs StrAPPL_PHYSICAL_PATH & StrFolderPath & Session("NewsID") & "_mini" & File1.Ext
File2.SaveAs StrAPPL_PHYSICAL_PATH & StrFolderPath & Session("NewsID") & "_maxi" & File2.Ext
UpdateSQL = "update TblNews Set "
UpdateSQL = UpdateSQL & "StrImageMini='" & "haber_uploads/" & Session("NewsID") & "_mini" & File1.Ext & "', "
UpdateSQL = UpdateSQL & "StrImage='" & "haber_uploads/" & Session("NewsID") & "_maxi" & File2.Ext & "' WHERE NewsID=" & Session("NewsID")
ObjConn.Execute(UpdateSQL)
Session("NewsID") = ""
Response.Redirect "../haber_admin/error.asp?StrMsg=Resim / Resimler baþarýyla eklenmiþtir.&StrRefer=news.asp"
Response.End
Set ObjFileObject1 = Nothing
Set ObjFso1 = Nothing
Set File1 = Nothing
Set ObjFileObject2 = Nothing
Set ObjFso2 = Nothing
Set File2 = Nothing
Set Upload = Nothing
%>
----admin_connections.asp---
<%
'On Error Resume Next

Set ObjConn = CreateObject("ADODB.Connection")
StrDbName = "../haber_dba/database.mdb"
StrVirtualDbName = "../haber_dba/database.bak"
StrConn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath(StrDbName)

ObjConn.Open StrConn
%>


----pagesettings.asp---
<%
Response.Buffer = True
Response.Expires = 0
Response.Expiresabsolute = Now() - 1
Response.CacheControl = "no-cache"
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Set ObjSettings = Createobject("ADODB.Recordset")
ObjSettings.open "SELECT * FROM TblSettings", ObjConn , 3 , 1
StrPageTitle = ObjSettings("StrPageTitle")
StrPageVer = ObjSettings("StrPageVer")
StrPageEmail = ObjSettings("StrPageEmail")
StrFolderPath = ObjSettings("StrFolderPath")
StrBackupPath = ObjSettings("StrBackupPath")
StrDocsPath = ObjSettings("StrDocsPath")
StrImagePath = ObjSettings("StrImagePath")
StrPhotoPath = ObjSettings("StrPhotoPath")
StrPageUrl = ObjSettings("StrPageUrl")
StrUpdateDate = ObjSettings("StrUpdateDate")
StrBackupDate = ObjSettings("StrBackupDate")
StrRepairDate = ObjSettings("StrRepairDate")
StrFooter = ObjSettings("StrFooter")
StrPageTblBody = "#FFFFFF"
StrPageBody = "#F4F4F4"
StrPageLeft = "#0D3159"
StrPageLeft_T = "#5B87B8"
StrPageHeader = "#DF002B"
StrPageHeader_T = "#E4E4E4"
StrPageFooter = "#DF002B"
StrPageMenuLeft = "#EFF1F5"
ObjSettings.Close()
Set ObjSettings = Nothing
StrScriptName = Request.ServerVariables("SCRIPT_NAME")
StrAPPL_PHYSICAL_PATH = Request.ServerVariables("APPL_PHYSICAL_PATH")
StrPath = StrAPPL_PHYSICAL_PATH & StrFolderPath
%>

yardımcı olur diye include edilen sayfaları da yazıyorum..