|
 |
|
Dev Articles Community Forums
> Programming
> ASP Development
|
what is that problem
Discuss what is that problem in the ASP Development forum on Dev Articles. what is that problem ASP Development forum discussing your ASP or Visual Basic problems, solutions and code posts. Active Server Pages help you create dynamic websites using powerful scripting technologies.
|
|
 |
|
|
|

Dev Articles Community Forums Sponsor:
|
|

June 23rd, 2004, 12:12 PM
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 32
Time spent in forums: 2 h 43 m 37 sec
Reputation Power: 15
|
|
what is that problem
Hi,
can anyone help me, i m getting this error in two regdownload.asp and regnews.asp files.... i dont know what is going on
Error Type:
Microsoft JET Database Engine (0x80004005)
Number of query values and destination fields are not the same.
/firstequity/regnews.asp, line 9
plz doo help me out
|

June 23rd, 2004, 08:15 PM
|
 |
May contain nuts.
|
|
Join Date: Aug 2002
Posts: 2,056
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
|
|
INSERT statements look like this:
Code:
INSERT INTO tableName (fieldNames, ...) VALUES (fieldValues, ...)
You are missing the fieldNames portion.
|

June 23rd, 2004, 08:51 PM
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 32
Time spent in forums: 2 h 43 m 37 sec
Reputation Power: 15
|
|
Error Type:
Microsoft JET Database Engine (0x80040E14)
Syntax error in INSERT INTO statement.
/firstequity/regnews.asp, line 8
now i am getting this error if i write this below query with a response.write then it shows me that data is going on but when i use Conn.Execute then it shows me
Response.Write "Insert into News1 values('" & s & "', '" & n & "', '#" & Date & "#')"
Error Type:
Microsoft JET Database Engine (0x80004005)
Number of query values and destination fields are not the same.
/firstequity/regnews.asp, line 9
i have also attached the files with my first post. u can even check it out.
|

June 23rd, 2004, 08:53 PM
|
 |
May contain nuts.
|
|
Join Date: Aug 2002
Posts: 2,056
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
|
|
Re-read my post carefully. Or go and read how to correct write an insert statement - there are tutorials all over the net.
|

June 23rd, 2004, 09:06 PM
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 32
Time spent in forums: 2 h 43 m 37 sec
Reputation Power: 15
|
|
Can u tell me which one is correct
Conn.Execute "Insert into News1(s,n,Dt) values ('" & s & "', '" & n & "', '#" & Date & "#')"
or like this
Conn.Execute "Insert into News1(subject,news,Dt) values ('" & s & "', '" & n & "', '#" & Date & "#')"
|

June 23rd, 2004, 09:11 PM
|
 |
May contain nuts.
|
|
Join Date: Aug 2002
Posts: 2,056
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
|
|
the fieldName list comprises of your field names from your database table. So, if your field name is subject, then write subject... e.g.
Code:
insert into news (subject) VALUES ('" & varSubject & "')
|

June 23rd, 2004, 09:18 PM
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 32
Time spent in forums: 2 h 43 m 37 sec
Reputation Power: 15
|
|
Conn.Execute "Insert into News1(subject,news,Date) values ('" & subject & "', '" & news & "', '#" & Date & "#')"
its is showing me
Microsoft VBScript runtime (0x800A01F5)
Illegal assignment: 'Date'
/firstequity/regnews.asp, line 6
|

June 23rd, 2004, 09:21 PM
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 32
Time spent in forums: 2 h 43 m 37 sec
Reputation Power: 15
|
|
i m using this hole code
<!--#include file="conn.asp" -->
<%
Dim ut, s, n
subject = Request.Form("subject")
news = Request.Form("news")
Date = Request.Form("Dt")
Conn.Execute "Insert into News1(subject,news,Date) values ('" & subject & "', '" & news & "', '#" & Date & "#')"
'Conn.Execute "Insert into News1 values('" & s & "', '" & n & "', '#" & Date & "#')"
'Response.Write "Insert into News1 values('" & s & "', '" & n & "', '#" & Date & "#')"
%>
|

June 23rd, 2004, 09:27 PM
|
 |
May contain nuts.
|
|
Join Date: Aug 2002
Posts: 2,056
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
|
|
Date is a function (i.e. Date()) - instead, call your variables something like varDate, or dDate.
|

June 23rd, 2004, 09:36 PM
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 32
Time spent in forums: 2 h 43 m 37 sec
Reputation Power: 15
|
|
Insert into News1(subject,news,NDate) values ('" & subject & "', '" & news & "', '#" & dDate & "#')
with this query date is not comming
|

June 23rd, 2004, 09:50 PM
|
 |
May contain nuts.
|
|
Join Date: Aug 2002
Posts: 2,056
Time spent in forums: 5 h 44 m 22 sec
Reputation Power: 0
|
|
Are you getting an error? Also, response.write your variables (subject, news, nDate) before inserting them into the query to ensure they contain data.
|

June 23rd, 2004, 09:57 PM
|
Contributing User
|
|
Join Date: Aug 2003
Posts: 32
Time spent in forums: 2 h 43 m 37 sec
Reputation Power: 15
|
|
Thanks its done now
Thanks again  
|
Developer Shed Advertisers and Affiliates
Thread Tools |
Search this Thread |
|
|
Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|