Command | Insert = error

Hi:

I have used the Insert Command a zillion times in DW MX 2004 but in DW CS3 I cannot get it to work even with the most simplest attempts.

I keep geeting the error:

Microsoft VBScript compilation error '800a0408'
Invalid character
/comp/compinsert.asp, line 4 Dim cmdInsert__@@varName@@

Does anyone know how to fix this?

Thanks!
Mitch
CODE<%
Dim cmdInsert__@@varName@@
cmdInsert__@@varName@@ = "@@defaultValue@@"
If (@@runtimeValue@@ <> "") Then 
cmdInsert__@@varName@@ = @@runtimeValue@@
End If
%>
<%Set cmdInsert = Server.CreateObject ("ADODB.Command")
cmdInsert.ActiveConnection = MM_xxxxxxxxxxxx_STRING
cmdInsert.CommandText = "INSERT INTO lookup_company (company_name) VALUES ('test' ) "
cmdInsert.CommandType = 1
cmdInsert.CommandTimeout = 0
cmdInsert.Prepared = true
cmdInsert.Execute()
%>

Open in new window

Mitchel-TAsked:
Who is Participating?
 
hongjunCommented:
I am not familiar with using CS3 to code. But I believe the below will work.
<%
Dim cmdInsert__varName
cmdInsert__varName = "defaultValue"
If (runtimeValue <> "") Then 
cmdInsert__varName = runtimeValue
End If
%>
<%Set cmdInsert = Server.CreateObject ("ADODB.Command")
cmdInsert.ActiveConnection = MM_xxxxxxxxxxxx_STRING
cmdInsert.CommandText = "INSERT INTO lookup_company (company_name) VALUES ('test' ) "
cmdInsert.CommandType = 1
cmdInsert.CommandTimeout = 0
cmdInsert.Prepared = true
cmdInsert.Execute()
%>

Open in new window

0
 
Jason C. LevineNo oneCommented:
Hi Mitchel-T,

Was this page created initally with MX and is now being edited with CS3?  If so, you may have to remove all instances of the MX-generated code and replace it with new behaviors.  Adobe has changed the code around and the two versions may generate the error you see.
0
 
Mitchel-TAuthor Commented:
Hi Jason,

No, this page was totally done in CS3.

I created a new blank asp page, and created a super simple insert command.

Thanks,

Mitch
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
Jason C. LevineNo oneCommented:
Damn, so much for the easy fix.

Do this:

Try opening the ASP page in NotePad and see if there are any garbage characters at the top of the file.  Sometimes stuff gets garbled by DW and some extra "hidden" characters appear in the plain text version that are otherwise invisible in the DW editor
0
 
Mitchel-TAuthor Commented:
Jason,

No luck...no garbage characters.

Sure looks like Adobe messed something up with CS3?

Thanks,

Mitch
0
 
Jason C. LevineNo oneCommented:
I'm stumped and since I don't touch ASP I'm not the best guy to answer.  I'm going to ask the Mods to change the Zones for you and resend alerts.
0
 
Mitchel-TAuthor Commented:
OK...thanks!
0
 
hongjunCommented:
Variable names cannot have @ character.
What are you trying to do?
0
 
Mitchel-TAuthor Commented:
hongjun:

I am trying to use the COMMAND / INSERT function of Dreamweaver CS3.

This always worked in Dreamweaver MX 2004, but with the new security features of CS3 they changed the code.

Do you recommend I remove all of the @ characters or replace them with something?

Thanks,

Mitch
0
 
Mitchel-TAuthor Commented:
hongjun:

Well...I feel pretty silly for not trying that myself...it worked!

I wonder why Adobe included those pesky @?

Thanks,

Mitch
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.