Wrox Programmer Forums
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 11th, 2009, 04:53 PM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 207
Thanks: 2
Thanked 15 Times in 15 Posts
Default Again....

I should read more carefully... This is SUPPOSE to be vb so your code looks wrong in general. You should be using & and not +

query = "USE [TrapDB] "
query = query & "GO "
query = query & "DECLARE @return_value int "
query = query & "DECLARE @Data Binary(4096) "
query = query & "SET @Data =CONVERT(binary(4096)," & Validate("ahoj") & ") "
query = query & "EXEC @return_value = [dbo].[LBLPRT_AddPrintJob] "
query = query & " @PrintServer = N" & Validate(Text3) & ","
query = query & " @PrinterName = N" & Validate(Text4) & ", "
query = query & " @PrintedBy = N" & Validate(UserName) & ", "
query = query & " @PrintedFrom = N" & Validate(ComputerName) & ", "
query = query & " @PrintIssued = N" & Validate(Format(Now, "YYYY-MM-DD hh:mm:ss")) & ", "
query = query & " @PrintData = @Data "
query = query & "GO "


But yes if you just call the SP directly you don't need to worry about any of this!
__________________
Jason Hall

Follow me on Twitter @jhall2013

Last edited by alliancejhall; May 11th, 2009 at 04:55 PM.. Reason: Missed some +s
 
Old May 11th, 2009, 04:59 PM
Authorized User
 
Join Date: Dec 2007
Posts: 21
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via ICQ to vanik.cz
Default

This will invoke an error. Because of GO must reside in single line. But as I told you, other breaks was there for the cosmetic purposes :-D, But it isnt help at all, I was try it before I submit this thread.
__________________
JVV





Similar Threads
Thread Thread Starter Forum Replies Last Post
Incorrect syntax near '.' meraj ADO.NET 6 February 27th, 2012 01:01 AM
Line 6: Incorrect syntax near garrydawkins SQL Server 2000 2 April 10th, 2006 03:39 PM
Incorrect syntax near '!' sinapra Classic ASP Databases 8 August 25th, 2004 02:15 AM
Incorrect syntax near '`' Hez Classic ASP Databases 3 August 5th, 2004 08:13 AM
Incorrect syntax...... Adam H-W Classic ASP Databases 8 June 21st, 2004 11:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.