 |
|
ช่วยดู error ให้หน่อยค่ะ ขอบคุณมากค่ะ Error Type: Microsoft OLE DB Provider for ODBC Drivers |
|
 |
|
|
 |
 |
|
ลอง เอาเครื่องหมาย # ออกดูสิครับ
SQL="SELECT * FROM Helpdesk_Service_order WHERE a_date = "& year(date)&"/"&month(date)&"/"&day(date)&""
ลองดูนะครับ ผมกะไม่ค่อยเก่งเท่าไหร่ แต่ก็อยากช่วยน้า
|
 |
 |
 |
 |
Date :
24 ม.ค. 2549 14:52:54 |
By :
ผ่านมาคับ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณ คุณผ่านมา ค่ะ
ลองลบออกแล้วเกิด error ตัวนี้ค่ะ
Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/helpdesk_system/select_job_type.ASP, line 19

|
 |
 |
 |
 |
Date :
24 ม.ค. 2549 15:28:03 |
By :
May |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองอันนี้ก่อนน้า
SQL="SELECT * FROM Helpdesk_Service_order WHERE a_date = "& year(date)&""
[email protected] add มาได้เลยหนะ
|
 |
 |
 |
 |
Date :
24 ม.ค. 2549 16:32:41 |
By :
ผ่านมา |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
SQL="SELECT * FROM Helpdesk_Service_order WHERE year(a_date) = "& year(date)&""
|
 |
 |
 |
 |
Date :
24 ม.ค. 2549 18:27:39 |
By :
อิอิ |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สวัสดีครับ
อันดับแรกเลยนะครับที่มองเห็น
1.
17=== > set RS = Conn_helpdesk.execute(SQL)
18=== > set RS = Server.CreateObject("adodb.recordset")
19 === > RS.Open SQL,Conn,1,3
ทำไม่ Open RS สองตัวละครับ ด้วยชื่อเดียว
2. ตรง SQL น่ะถูกแล้วครับ ยังไงลอง Write ออกมาดูก่อน ที่จะทำอะไรก็ได้นะครับ
Wiwat Keawsook
MSN : [email protected]
Yahoo : [email protected]
Google Talk : [email protected]
QQ : 67176
ICQ : 36338120
|
 |
 |
 |
 |
Date :
25 ม.ค. 2549 00:07:53 |
By :
Wiwat K. |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
รบกวนพี่วิวัฒน์ช่วยแก้ไขให้ดูเป็นตัวอย่างด้วยค่ะ พอดีหนูไม่ค่อยเขาใจอ่ะ ขอบคุณมากค่ะ
|
 |
 |
 |
 |
Date :
25 ม.ค. 2549 09:29:41 |
By :
may |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่ทราบว่าใช้ฐานข้อมูลของอะไรครับ ถ้าเป็นของ Access และไม่รู้ว่ากำหนดชนิดของฟิลด์ a_date เป็นแบบไหน โดยส่วนมากแล้วใน Accees ฟิลด์ที่มีชนิดเป็น Date/Time จะอยู่ในรูปแบบ d/m/y วัน/เดือน/ปี ดังนั้นแล้วก็ทำตามตัวอย่างข้างล่างนี้
SQL="SELECT * FROM TABLENAME WHERE FIELDDATE=#"&day(date)&"/"&month(date)&"/"year(date)&"# ORDER BY FIELDNAME ASC"
|
 |
 |
 |
 |
Date :
25 ม.ค. 2549 13:30:30 |
By :
นายกระจอก |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช้ฐานข้อมูล MSSQL ค่ะ a_date เป็นแบบ datetime ค่ะ
|
 |
 |
 |
 |
Date :
25 ม.ค. 2549 15:52:00 |
By :
May |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ถ้าเป็น MSSQL รู้สึกว่าจะใช้เครื่องหมายเปอร์เซ็นต์ (%) แทนเครื่องหมายชาร์ป (#) นะครับ หรือไม่ก็อาจจะไม่ต้องใช้เลย ยังไงก็ลอง ๆ ดูนะครับ
|
 |
 |
 |
 |
Date :
25 ม.ค. 2549 16:34:32 |
By :
นายกระจอก |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<%@ language = vbscript%>
<!-- #include file="../helpdesk_system/conn.asp" -->
<%
sql1 = "Select * from Helpdesk_Job_type"
set rsjobtype = Conn_helpdesk.execute(sql1)
sql2 = "select * from Helpdesk_Service_order"
set rs_s = Conn_helpdesk.execute(sql2)
set rs_s = Server.CreateObject("adodb.recordset")
'rs_s.Open sql2,Conn_helpdesk,1,3
'*******************************************************
a_date = now()
'**************************************************
SQL="SELECT * FROM Helpdesk_Service_order WHERE a_date = #"& year(date)&"/"&month(date)&"/"&day(date)&"#"
'SQL="SELECT * FROM Helpdesk_Service_order WHERE a_date = "& year(date)&"/"&month(date)&"/"&day(date)
'**************************************************
set RS = Conn_helpdesk.execute(SQL)
set RS = Server.CreateObject("adodb.recordset")
RS.Open SQL,Conn_helpdesk,1,3
'**************************************************
If Request.Form("Job_Id")<>"" Then
'=========ส่วนการสร้าง ID ในขอบเขตวันที่
IDdate=Right(year(date),2) '== สร้าง ID 1-2 ด้วยหลักหน่วยและหลักสิบของ ค.ศ.
If len(Month(date))=1 then '== สร้าง ID 3-4 ด้วย ค่าเดือนและเช็คหลักด้วย ถ้ามีหลักเดียวก็ เติม 0
IDdate=IDdate & "0" & Month(date)
Else
IDdate=IDdate & Month(date)
End If
If len(day(date))=1 then '== สร้าง ID 5-6 ด้วย ค่าวันและเช็คหลักด้วย ถ้ามีหลักเดียวก็ เติม 0
IDdate=IDdate & "0" & day(date)
Else
IDdate=IDdate & day(date)
End If
'=========ส่วนการสร้าง ID ในขอบข่าย จำนวน
RS.AddNew
RS("Service_id")=IDdate & Request.Form("Job_Id") & "001"
RS("a_date")=year(date)&"/"&month(date)&"/"&day(date)
RS.Update
Else
'=========ส่วนการสร้าง ID ในขอบเขตวันที่
IDdate=Right(year(date),2) '== สร้าง ID 1-2 ด้วยหลักหน่วยและหลักสิบของ ค.ศ.
If len(Month(date))=1 then '== สร้าง ID 3-4 ด้วย ค่าเดือนและเช็คหลักด้วย ถ้ามีหลักเดียวก็ เติม 0
IDdate=IDdate & "0" & Month(date)
Else
IDdate=IDdate & Month(date)
End If
If len(day(date))=1 then '== สร้าง ID 5-6 ด้วย ค่าวันและเช็คหลักด้วย ถ้ามีหลักเดียวก็ เติม 0
IDdate=IDdate & "0" & day(date)
Else
IDdate=IDdate & day(date)
End If
'=== ตรวจสอบค่าขอบข่ายจำนวน
topstaffID=0
RS.MoveFirst
Do Until RS.EOF
If Request.Form("Job_Id")=Mid(RS("Service_id"), 7, 1) Then
if cInt(Right(RS("Service_id"),3))>topstaffID Then topstaffID=cInt(Right(RS("Service_id"),3))
End If
RS.MoveNext
Loop
'=========ส่วนการสร้าง ID ในขอบข่าย จำนวน
IDstaff=cInt(Right(RS("Service_id"),3))+1 '=== นำค่า 3 ตัวของ ID มา แปลงเป็นเลขจำนวนเต็ม
IDstaff=topstaffID+1
If len(IDstaff)=1 Then
IDstaff="00" & IDstaff
ElseIf len(IDstaff)=2 Then
IDstaff="0" & IDstaff
End If
RS.AddNew
RS("Service_id")=IDdate & Request.Form("Job_Id") & IDstaff
RS("a_date")=year(date)&"/"&month(date)&"/"&day(date)
RS.Update
End If
RS.Close
Set RS=Nothing
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<title>Select Job Type</title>
<body>
<!-- <link href="style/style.css" rel="stylesheet" type="text/css"> -->
<FORM name = "userinfo" action="Select_Job_Type.asp" method="post" onsubmit="">
<p>
<label>ลักษณะงานที่ซ่อม</label><!--comment>ลักษณะงานที่ซ่อม<!--comment-->
<select name="Job_Id" >
<option value="" selected >--โปรดเลือก ลักษณะงาน--</option>
<%
strsql1 = "Select * from Helpdesk_Job_type "
Set rsjobtype = Conn_helpdesk.execute(strsql1)
do until rsjobtype.eof
response.write"<option value ="""&rsjobtype("Job_Id")&""">"&rsjobtype("Type_Detail")&"</option>"
rsjobtype.movenext
loop
%>
</select>
</p>
<p>
<input type=reset name=reset value="Reset" >
<input type="submit" name= Submit value="Save" >
</form>
</p>
|
 |
 |
 |
 |
Date :
25 ม.ค. 2549 16:39:01 |
By :
May |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '#'.
/helpdesk_system/select_job_type.ASP, line 18
|
 |
 |
 |
 |
Date :
25 ม.ค. 2549 16:40:05 |
By :
May |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอถามด้วยคนครับมันขึ้นแบบนี้แก้ยังไงครับ
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/computermart/db/db1.asp, line 12
|
 |
 |
 |
 |
Date :
25 ก.พ. 2549 00:50:05 |
By :
anukul_nu |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|