<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Everyone,<br>
<br>
I actually figured out how to make this work by viewing the php code
for the DCMMS application.  I needed to add the database after the
table name and now it works.  <br>
<br>
In case anyone else runs into this the command I now use is:<br>
"C:\gps_maps\postgis_sql\shp2pgsql.exe" -d
"C:\gps_maps\mississippi_topo\transportation\all_lines.shp" all_lines
postgis >
"C:\gps_maps\mississippi_topo\transportation\all_lines.sql" <br>
<br>
Dan<br>
<br>
Daniel Blomberg wrote:
<blockquote
 cite="mid:ed9b3c030806011257k61b0070w7a823ddf1c784eb0@mail.gmail.com"
 type="cite">
  <pre>Paul & Regina,

Paul: I noticed there is no -f option.  Would I be able to run a command direct to psql (with the | ) without having to open the command prompt first? 

Regina: I tried that, good idea though.


More diagnosing: I am able to run pgsql from my program without an issue.  I tried to run shp2pgsql.exe from a .bat file I wrote and it also has the same error.  Anyone else have any ideas?

Thanks
Dan


QUOTED:
------------------------------

Message: 4
Date: Sun, 1 Jun 2008 06:39:09 -0400
From: "Paragon Corporation" <<a moz-do-not-send="true"
 href="mailto:lr@pcorp.us">lr@pcorp.us</a>>
Subject: RE: [postgis-users] Can't Call shp2pgsql.exe From "Run" or VB

        Program,        only works with DOS prompt opened first
To: "'PostGIS Users Discussion'"
        <<a moz-do-not-send="true"
 href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>>
Message-ID: <000501c8c3d3$b936ef00$4d812e40@l>

Content-Type: text/plain;       charset="us-ascii"

Dan,

Could also be the VB code or  run statement is being truncated.  How are you
escaping out your double quotes in VB.

E.g. if you copy the files to root of C and then try it does it work?


Hope that helps,
Regina

 

-----Original Message-----
From: <a moz-do-not-send="true"
 href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a>
[mailto:<a moz-do-not-send="true"
 href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a>] On Behalf Of Paul

Ramsey
Sent: Saturday, May 31, 2008 6:05 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Can't Call shp2pgsql.exe From "Run" or VB
Program,only works with DOS prompt opened first


The redirect may not work when running it from Run... or exec inside a
program. This sort of argues for a -f option to write out to file without
needing a stdout redirect.

P

On Sat, May 31, 2008 at 2:49 PM, Daniel Blomberg <<a
 moz-do-not-send="true" href="mailto:services@gpsfiledepot.com">services@gpsfiledepot.com</a>>

wrote:
  </pre>
  <blockquote type="cite">
    <pre>Hi,

I am trying to run shp2pgsql.exe from inside a visual basic program I 
am writing.  Its not working so i tested the command I am sending from 
the "Run" dialog box in windows and it doesn't work.  The dos box pops 

up and goes away too fast but here is what I caught:
<a moz-do-not-send="true"
 href="http://www.gpsfiledepot.com/shp2pgsql.jpg">http://www.gpsfiledepot.com/shp2pgsql.jpg</a>

The command I am trying to run is:
"C:\gps_maps\postgis_sql\shp2pgsql.exe"

"C:\gps_maps\mississippi_topo\transportation\all_lines.shp" all_lines 
    </pre>
    <blockquote type="cite">
      <pre>"C:\gps_maps\mississippi_topo\transportation\all_lines.sql"
      </pre>
    </blockquote>
    <pre>If I run the command when the dos prompt is open it works. Ideas/help 

would be much appreciated.

Thanks in advance
Dan


_______________________________________________
postgis-users mailing list
<a moz-do-not-send="true"
 href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>

<a moz-do-not-send="true"
 href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>


    </pre>
  </blockquote>
</blockquote>
</body>
</html>