Danger, danger! UltraDev code ahead!

First off, do yourself a favor and try to ween yourself off UltraDev and
learn ASP and SQL from a good book and write the code yourself. It will
probably save you many headaches in the future.

I think that your problem might be twofold and they are related.

1 - The error message that you are getting may indicate that you have a NULL
or empty value for a field that is designated as NOT NULL. This makes sense
because the next problem is . . .

2 - Your INSERT statement is using a SELECT statement to chose VALUES to be
inserted into the table. Since MySQL does not support sub-SELECT statements,
the second part of your query is not returning any values, resulting in the
NULL value error stated above.

Therefore, my recommendation to you is to re-write this SQL statement.
First, you would need to create a recordset that has the values from the
second part of your query. Then, you could use these values to finish off
the SQL statement you currently have. In the end your statement should look
something like the following:

INSERT INTO testScores (**Field names from current SQL statement**)
VALUES (**Values from the recordset obtained from the second part of
existing query**)

(Obviously, I'm paraphrasing here)

Good Luck,

Dennis
**********************************************
Beridney Computer Services
http://www.beridney.com

----- Original Message -----
From: "Glenn Emery" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 02, 2001 8:34 AM
Subject: Let's try this again..HELP PLEASE


I am working with porting an ASP website that connected to an Access
Database to MySQL and am still very new to the Syntax differences.

I've found more than a majority of the site works except one crucial part
that submits the results of a survey into the database and am not sure
*exactly* where the problem lies because I get an error that states
ADODB.Connection.1 error '80004005'
SQLState: 42000
Native Error Code: 1064
[TCX][MyODBC]You have an error in your SQL syntax near '' at line 1

/profile/chemistrymatch/final.asp, line 633

yet line 633 is different depending on what I open the page up with.....When
I open with UltraDev line 633 reads..........con.Execute(sql) with word wrap
on and.......................
'*************************************************************************
' ADD NEW VALUES TO TESTSCORES IN DATABASE
'*************************************************************************

SQL = "INSERT INTO testScores (CUSTOMER_ID, creative, creativeDeveloper,
developer, refiner, maximizer, director, persuader, cooperator, analyst,
social, internal, futurist, realist, feeler, thinker, planner, adapter,
values1, values2, values3, values4, values5, values6, values7, values8,
values9, values10, values11, values12, values13, values14, values15,
values16, values17, values18, values19, values20, motivatedRole1,
motivatedRole2, motivatedRole3, MotivatedRole4, motivatedRole5, impactRole1,
impactRole2, impactRole3, impactRole4, tempermentProfile1,
tempermentProfile2, tempermentProfile3, tempermentProfile4,
tempermentProfile5, tempermentProfile6, tempermentProfile7,
tempermentProfile8, tempermentProfile9, tempermentProfile10,
tempermentProfile11, tempermentProfile12, tempermentProfile13,
tempermentProfile14, tempermentProfile15, tempermentProfile16,
undecidedCount3, undecidedCount4, undecidedCount5, undecidedCount6,
customerName, CORPORATE_CUSTOMER_ID) SELECT '" & CUSTOMER_ID & "' AS Expr1,
'" & creative & "' AS Expr2, '" & creativeDeveloper & "' AS Expr3, '" &
developer & "' AS Expr4, '" & refiner & "' AS Expr5, '" & maximizer & "' AS
Expr6, '" & director & "' AS Expr7, '" & persuader & "' AS Expr8, '" &
cooperator & "' AS Expr9, '" & analyst & "' AS Expr10, '" & social & "' AS
Expr11, '" & internal & "' AS Expr12, '" & futurist & "' AS Expr13, '" &
realist & "' AS Expr14, '" & feeler & "' AS Expr15, '" & thinker & "' AS
Expr16, '" & planner & "' AS Expr17, '" & adapter & "' AS Expr18, '" & v1 &
"' AS Expr19, '" & v2 & "' AS Expr20, '" & v3 & "' AS Expr21, '" & v4 & "'
AS Expr22, '" & v5 & "' AS Expr23, '" & v6 & "' AS Expr24, '" & v7 & "' AS
Expr25, '" & v8 & "' AS Expr26, '" & v9 & "' AS Expr27, '" & v10 & "' AS
Expr28, '" & v11 & "' AS Expr29, '" & v12 & "' AS Expr30, '" & v13 & "' AS
Expr31, '" & v14 & "' AS Expr32, '" & v15 & "' AS Expr33, '" & v16 & "' AS
Expr34, '" & v17 & "' AS Expr35, '" & v18 & "' AS Expr36, '" & v19 & "' AS
Expr37, '" & v20 & "' AS Expr38, '" & motivatedRole1 & "' AS Expr39, '" &
motivatedRole2 & "' AS Expr40, '" & motivatedRole3 & "' AS Expr41, '" &
motivatedRole4 & "' AS Expr42, '" & motivatedRole5 & "' AS Expr43, '" &
impactStyle1 & "' AS Expr44, '" & impactStyle2 & "' AS Expr45, '" &
impactStyle3 & "' AS Expr46, '" & impactstyle4 & "' AS Expr47, '" &
tempermentProfiles(1) & "' AS Expr48, '" & tempermentProfiles(2) & "' AS
Expr49, '" & tempermentProfiles(3) & "' AS Expr50, '" &
tempermentProfiles(4) & "' AS Expr51, '" & tempermentProfiles(5) & "' AS
Expr52, '" & tempermentProfiles(6) & "' AS Expr53, '" &
tempermentProfiles(7) & "' AS Expr54, '" & tempermentProfiles(8) & "' AS
Expr55, '" & tempermentProfiles(9) & "' AS Expr56, '" &
tempermentProfiles(10) & "' AS Expr57, '" & tempermentProfiles(11) & "' AS
Expr58, '" & tempermentProfiles(12) & "' AS Expr59, '" &
tempermentProfiles(13) & "' AS Expr60, '" & tempermentProfiles(14) & "' AS
Expr61, '" & tempermentProfiles(15) & "' AS Expr62, '" &
tempermentProfiles(16) & "' AS Expr63, '" & undecidedCount3 & "' AS Expr64,
'" & undecidedCount4 & "' AS Expr65, '" & undecidedCount5 & "' AS Expr66, '"
& undecidedCount6 & "' AS Expr67, '" & customerName & "' AS Expr68, '" &
CORPORATE_CUSTOMER_ID & "' AS Expr69"

with word wrap off....................Can anyone please point me in the
correct direction since this project was forced upon me and now that it is
mine I MUST succeed....It would be very different if I were asked to start
from scratch but I am expected to work with someone elses work and they no
longer are around.

Thank You!

Glenn



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to