Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 375
  • Last Modified:

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

0
Mitchel-T
Asked:
Mitchel-T
  • 5
  • 3
  • 2
1 Solution
 
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
 
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
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
 
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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 5
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now