Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Need 2nd pair eyes


Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2004, 01:53 PM
swoozie swoozie is offline
Junior Contributor
 
Join Date: Dec 2003
Location: PA
Posts: 380
Default Need 2nd pair eyes


Yelp! I have an error, I am pretty sure where it is but I can not remember how to write it:

MySql = "Insert into Temp_Invoice ([Invoice_ID], [SR_ID], [GL_Code],[Amount],[Journal]," & _
"[CreditFlag],[date],[Insert_Date]) (values " & Chr(34) & Inv & Chr(34) & "," & Chr(34) & sr & Chr(34) & "," & _
Chr(34) & GL & Chr(34) & "," & amt & "," & Chr(34) & Jour & Chr(34) & "," & Chr(34) & Flag & _
Chr(34) & "," & InDate & "," & CurDate & ""


What is the chr() value that goes around dates?
__________________
Swoozie

Somedays you just shouldn't get out of bed in the morning.
Reply With Quote
  #2  
Old 02-11-2004, 02:01 PM
vbFace's Avatar
vbFace vbFace is offline
Contributor
 
Join Date: Sep 2003
Location: New Jer$ey
Posts: 540
Default

You want the Chr() for "#". You have the Chr for double-quotes.
Reply With Quote
  #3  
Old 02-11-2004, 02:03 PM
swoozie swoozie is offline
Junior Contributor
 
Join Date: Dec 2003
Location: PA
Posts: 380
Default

Quote:
Originally Posted by vbFace
You want the Chr() for "#". You have the Chr for double-quotes.



I assumed that was where my problem was that is why I asked what the chr() was for dates i.e., #

Do you know?
__________________
Swoozie

Somedays you just shouldn't get out of bed in the morning.
Reply With Quote
  #4  
Old 02-11-2004, 02:05 PM
vbFace's Avatar
vbFace vbFace is offline
Contributor
 
Join Date: Sep 2003
Location: New Jer$ey
Posts: 540
Default

In the Immediate window, type
Code:
?Asc("#")
That number will be the one for Chr().
Reply With Quote
  #5  
Old 02-11-2004, 02:08 PM
swoozie swoozie is offline
Junior Contributor
 
Join Date: Dec 2003
Location: PA
Posts: 380
Default

Quote:
Originally Posted by vbFace
In the Immediate window, type
Code:
?Asc("#")
That number will be the one for Chr().



dont have a clue what that meant, but

Doesnt matter since there is a syntax error else where prob a comma or something out of place
__________________
Swoozie

Somedays you just shouldn't get out of bed in the morning.
Reply With Quote
  #6  
Old 02-11-2004, 02:11 PM
vbFace's Avatar
vbFace vbFace is offline
Contributor
 
Join Date: Sep 2003
Location: New Jer$ey
Posts: 540
Default

I am assuming you are using VB or VBA within Access. If you don't know what the Immediate Window is, find out! You will love all of the things that you can do with it while debugging. For instance, if you put a breakpoint in the code, you can type in the Immediate Window "? MySql" and it will show you the actual string.

To get the Immediate Window in VB or Access VBA, click VIEW --> Immediate.
Reply With Quote
  #7  
Old 02-11-2004, 03:00 PM
gellerche gellerche is offline
Centurion
 
Join Date: Sep 2003
Location: Bloomington, IL
Posts: 168
Default

Also, you have:

(values

when it should be:

values (

You will also need to have an end parens ie. ) at the end of your Insert statement.
Reply With Quote
  #8  
Old 02-11-2004, 03:02 PM
swoozie swoozie is offline
Junior Contributor
 
Join Date: Dec 2003
Location: PA
Posts: 380
Default

Quote:
Originally Posted by gellerche
Also, you have:

(values

when it should be:

values (

You will also need to have an end parens ie. ) at the end of your Insert statement.



Thanks Gellerche
__________________
Swoozie

Somedays you just shouldn't get out of bed in the morning.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
eyes eyes n more eyes!!! (i!!!) Please Help gadgetic Word, PowerPoint, Outlook, and Other Office Products 1 06-23-2003 12:57 PM
SQL Joins (I need another set of eyes) stonesrock Database and Reporting 2 06-03-2003 03:23 PM
SQL Syntax...Good eyes needed MKoslof Database and Reporting 11 10-29-2002 08:23 AM
type mismatch??? need eyes lorincha Word, PowerPoint, Outlook, and Other Office Products 4 05-28-2002 01:01 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->