ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
  #1  
Old August 1st, 2003, 12:49 PM
zalia zalia is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Location: brunei
Posts: 4 zalia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy pls help me

hi,

Actually i'm new in this programming. I have a problem with my script. I don't have any idea how to solve it.

i have 2 table (table maklumatpembeli and table bank) i want to insert data from table bank to table maklumatpembeli based on range date and id

here is my script:
<%
Dim conn
Dim rs
Dim MYSQL,MYSQL2

Set conn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
Set cmd = Server.CreateObject("ADODB.Recordset")
conn.ConnectionString = "DSN=prmm;UID=administrator;"
conn.Open

startdate=request("tarikh1")
enddate=request("tarikh2")


MYSQL = "SELECT * FROM bank where paymentdate between '" & startdate & "' and '" & enddate & "'"
rs.open MYSQL,conn

if rs.EOF then
response.Write("no data")
else
if ([bank.id] = [maklumatpembeli.id]) then
MYSQL2 = "INSERT INTO maklumatpembeli (paymentdate, status, no_resit) values ('" & rs ("paymentdate") & "', '" & rs ("status") & "', '" & rs ("no_resit") & "')"
Set rs = conn.Execute(MYSQL2)

response.write "<p>" & "<center>" & "The transaction have been done" & "</center>" & "</p>"
response.write "<p>" & "<A HREF=javascript:history.go(-1)>" & "GoBack" & "</a>"
else
response.write "No Transaction"
response.write "<p>" & "<A HREF=javascript:history.go(-1)>" & "GoBack" & "</a>"
end if
end if

Set rs = Nothing
Set conn = Nothing
%>

the error message i get like below:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'id', table 'rumahmampumilik.dbo.maklumatpembeli'; column does not allow nulls. INSERT fails.
/bank.asp, line 40

i don't understand! i don't want to insert the id only a few fields in table bank to table maklumatpembeli.

can someone pls help me what wrong with my program?

Reply With Quote
  #2  
Old August 14th, 2003, 09:57 PM
unatratnag unatratnag is offline
Average Intelligence
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2003
Location: Ohio/Chicago
Posts: 678 unatratnag User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 54 sec
Reputation Power: 6
Send a message via AIM to unatratnag
This is a SQL problem and not ASP.

Your database had column ID set up as "Not allow Nulls". You cannot start a new row unless you specify a value for that field, you'll have to reachitect the DB if you're bent on not using a value in ID. But that's the point of ID might i add, it IDentifies the column and should have a value.

Also use a better subject line than "pls help me" that's just sucky....

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > pls help me


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway