473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Load using VB6

Hi,

I'm tring to execute LOAD command with VB6.

...connection...

strSQL = "load from c:\temp\pippo.dat of del modified by coldel'|'
insert into MYTAB"
cnnMain.Execute (strSQL)

This code returns an error like this:
[IBM][CLI Driver][DB2/NT] SQL0007N the character "\" after "load from
c:" is not valid. SQLSTATE=42601

The same command in a file .bat works fine.

How can I resolve this prblem?

thanks.
Nov 12 '05 #1
3 2263
In article <73*************************@posting.google.com> , grigno
(ma*****@tin.it) says...
Hi,

I'm tring to execute LOAD command with VB6.

..connection...

strSQL = "load from c:\temp\pippo.dat of del modified by coldel'|'
insert into MYTAB"
cnnMain.Execute (strSQL)

This code returns an error like this:
[IBM][CLI Driver][DB2/NT] SQL0007N the character "\" after "load from
c:" is not valid. SQLSTATE=42601

The same command in a file .bat works fine.

How can I resolve this prblem?

thanks.

Maybe "load from 'c:\temp\pippo.dat' of del modified by ......" will
work?
Nov 12 '05 #2
You are trying to run it from within ADO. Load is not an "SQL"
statement or an internal dbms command. It is a application that
connects to the DB, reads a file and inserts the data into the DB.

What you have to do is run it from a Shell. I am not a VB expert,
however you might find that it runs out-of-process. If you are a good
VB programmer you will figure out how to run it in-process.

Shell(pathname[,windowstyle])

Bottom line, run it from a shell in VB.

Hope this helps,

Christos Kalantzis

grigno wrote:
Hi,

I'm tring to execute LOAD command with VB6.

..connection...

strSQL = "load from c:\temp\pippo.dat of del modified by coldel'|'
insert into MYTAB"
cnnMain.Execute (strSQL)

This code returns an error like this:
[IBM][CLI Driver][DB2/NT] SQL0007N the character "\" after "load from
c:" is not valid. SQLSTATE=42601

The same command in a file .bat works fine.

How can I resolve this prblem?

thanks.

Nov 12 '05 #3
grigno wrote:
Hi,

I'm tring to execute LOAD command with VB6.

..connection...

strSQL = "load from c:\temp\pippo.dat of del modified by coldel'|'
insert into MYTAB"
cnnMain.Execute (strSQL)

This code returns an error like this:
[IBM][CLI Driver][DB2/NT] SQL0007N the character "\" after "load from
c:" is not valid. SQLSTATE=42601

The same command in a file .bat works fine.

How can I resolve this prblem?


LOAD is a DB2 command and no SQL statement. You could use the call to the
db2Load API into a stored procedure and call the procedure from your
application. The CALL is a SQL statement.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Shabam | last post by:
A web application of mine developed using C# + MS SQL runs fine normally. However when I stress test it with a load testing software (using about 60 simultaneous users) some instances start...
6
by: JS | last post by:
EE instance DB2 v7.2.0 fixpack 3 on WIN2K. I select some data from a table A and write it to a file using the COALESCE function and whitespace as the null character: eg coalesce(col1, ' '). This...
3
by: Arti Potnis | last post by:
Hi, I am trying to execute the DB2 load utility from a C program. lPid = fork(); execl(csExePath, csExeName,csCmd, NULL); the contents of the parameter variables are as follows:-
1
by: Greg Patrick | last post by:
My problem: I load an some assemblies (strong named) from a byte array using Assembly.Load(byte). They load fine. But one one of them is actually accessed, it's referenced assemblies can't be...
2
by: brianbender | last post by:
I am trying to load and unload assemblies dynamically and call methods and properties when loaded into an Appdomain I can load assemblies all day in the current AppDomain without references and...
2
by: **Developer** | last post by:
I have a Form (FV&C) containing a userconrtrol (CF&E) I do a ShowDialog for the form and the form's Load calls a method of the UserControl. The first time I do this the usercontrol appears on...
6
by: tony | last post by:
Hello! When exactly is it important or advisable to use this form load event handler compare to using the C-tor. For example here I create an event handler called dataBoundGridForm that is...
0
by: bg_ie | last post by:
Hi all, I'm writing a .net Com object to read messages from an external bus. Also, under certain situations, I output messages to the bus in order to generate bus load, for testing purposes. An...
2
by: David Thielen | last post by:
So we have moved our app from .NET version 2.X in IIS6 to a Windows 2008 Server running IIS7. We have copied all files to the Windwardreports\apps directory and that apps directory has been...
13
by: rdudejr | last post by:
Hi all, I hardly ever make a post unless I am having a very purplexing issue, so this one should be good... I am trying to do a load against a database on an AIX server into a DB2 v9.1...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.