**************************************************************************************************************
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x1054 Thread 0x129c DBC 0x1cf0614 Jet'.
/SGM-GROUP/work/SetConnect.asp, line 29
Browser Type:
Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2)
Page:
POST 45 bytes to /SGM-GROUP/work/LogIn.asp
POST Data:
username=twee&password=1234&LOGIN_STATUS=TRUE
Time:
27 เมษายน 2554, 9:08:02
***********อันนี้ Code หน้า SetConnect.asp ******************************************************************
<style type="text/css">
<!--
body,td,th {
font-size: xx-small;
font-family: Tahoma;
}
-->
</style><%
Dim Conn, Recs, StrConn, StrSQL, TableName,VirtualPath, DBpath, DBpword
Dim DeleteID
'==========================================================================================
DBpword = ";uid=admin;password=ddb"
ServerName = request.servervariables("server_name")
if ServerName = "localhost" or ServerName = "surachart" or ServerName = "Surachart-1" then
DBpath = "/SGM-GROUP/Work/db/"
DBpath = "db/"
else
DBpath = "/work/db/"
end if
'response.write ServerName
'response.End
'==========================================================================================
Sub OpenConnect(DBfile,StrSQL)
Set Conn = Server.CreateObject("ADODB.Connection")
Set Recs = Server.CreateObject("ADODB.Recordset")
StrConn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(DBpath & DBfile)
StrConn = StrConn & DBpword
Conn.Open StrConn
Recs.Open strSQL, Conn, 1, 3
NumRec=Recs.RecordCount
End sub
'==========================================================================================
Sub CloseConnect
Conn.Close
Set Conn = Nothing
End sub
'==========================================================================================
Function AdjTime(hr)
If Request.Servervariables("SERVER_NAME") = "Surachart" Then AdjTime=Now() else AdjTime=DateAdd("h",hr,Now())
End Function
'==========================================================================================
Sub AddNewMessage(file,table)
ANow = AdjTime(0)
sql = "select * from " & table
Call OpenConnect(file,sql)
Recs.AddNew
Recs("Name")=Request("name")
if Request("Email")<>"" then Recs("Email")=Request("email")
Recs("message")=Request("message")
Recs("datetime")=Anow
Recs.Update
Call CloseConnect
End sub
'==========================================================================================
Sub DNum(digit,number)
response.write String(digit-len(number),"0")&number
End sub
'==========================================================================================
Dim Mthai,Meng
Mthai=array("","ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.","มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน","กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม")
Meng=array("","Jan","Feb","Mar","Apr","May","June","July","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December")
Sub DateTime(dt,con,lang)
d=Day(dt)
m=Month(dt)
y=Year(dt)
if lang=1 then
if y<2544 then y=y+543
elseif lang=2 then
if y>=2544 then y=y-543
end if
if con=1 or con=3 then
if lang=1 then m=Mthai(m+12) else m=Meng(m+12)
elseif con=2 or con=4 then
if lang=1 then m=Mthai(m) else m=Meng(m)
y=right(y,2)
end if
if con=3 or con=4 then
t=" <"&formatdatetime(dt,con)&">"
end if
if lang=1 then
Response.write d &" "& m &" "& y & t
else
Response.write m &" "& d &", "& y & t
end if
End sub
Function FDT(dt,con,lang)
d = Day(dt)
m = Month(dt)
y = Year(dt)
t = FormatDatetime(dt,4)
Select Case Ucase(lang)
Case "T" :
if y<2545 then y=y+543
if (con=1 or con=3) then
m=Mthai(m+12)
FDT = d &" "& m &" "& y &" "& t
else
m=Mthai(m)
FDT = d &" "& m & right(y,2) &" "& t
end if
Case "E" :
if y>=2545 then y=y-543
if (con=1 or con=3) then
m=Meng(m+12)
FDT = m &" "& d &", "& y &" "& t
else
m=Meng(m) : y=right(y,2)
FDT = m &" "& d &", "& y &" "& t
end if
End select
End function
'==========================================================================================
Dim text,speed,color,bgcolor
Sub OpenText(name)
Call OpenConnect("admin.mdb" , "Select * From ScrollText Where name='" & name &"'")
text=Recs("text")
speed=Recs("speed")
color=Recs("color")
bgcolor=Recs("bgcolor")
if bgcolor="#" then bgcolor=""
Call CloseConnect
End sub
Sub UpdateText(name,txt,spd,col,bgcol)
Call OpenConnect("admin.mdb" , "Select * From ScrollText Where name='" & name &"'")
Recs("text")=txt
Recs("speed")=spd
Recs("color")=col
Recs("bgcolor")=bgcol
Recs.Update
Call CloseConnect
End sub
'==========================================================================================
Dim NumVisitor
Sub SetFile(Filename)
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
HitsFile = Server.MapPath (Filename)
Set InStream= FileObject.OpenTextFile (HitsFile, 1, false )
OldHits = Trim(InStream.ReadLine)
InStream.Close
NewHits = OldHits + 1
Set OutStream= FileObject.CreateTextFile (HitsFile, True)
OutStream.WriteLine(NewHits)
OutStream.Close
NumVisitor=NewHits
End sub
Sub CounterPic(file,num,picname)
Call SetFile(file)
Len0 = num-len(NumVisitor)
Len1 = len(NumVisitor)
response.write "<table border=0 cellspacing=0 cellpadding=0><tr>"
for i=1 to Len0
response.write "<td><img src='counter/" & picname & "0.gif' align='absmiddle'></td>"
next
for i=1 to Len1
pic = picname & Mid(NumVisitor,i,1)
response.write "<td><img src='counter/" & pic & ".gif' align='absmiddle'></td>"
next
response.write "</tr></table>"
End sub
Sub CounterNum(file,num)
Call SetFile(file)
Len0 = num-len(NumVisitor)
Len1 = len(NumVisitor)
response.write string(Len0,"0")
for i=1 to Len1
response.write Mid(NumVisitor,i,1)
next
End sub
'=================================================================================================
Function CheckEmail(em)
if len(em)>5 or InStr(em,"@")>2 or InStr(em,".")>4 then em = "<a href='mailto:" & em &"'>" & em & "</a>" else em = ""
CheckEmail = em
End function
'=================================================================================================
%>