Permissions create sql table

The place for peer-to-peer support for developing client-server applications with VPME 9.1.

Permissions create sql table

Postby stecenko » Thu Sep 10, 2015 12:53 pm

Hi,

I have a VPME form that creates a string and uses sqlExec to create a table in an MS SQL database.
If the sqlExec fails, I write the string to a file.

If I run SQL Server Management Studio, I can copy/paste the string to a query window and it executes with out error.

My connection from VPME to MS is using Trusted Connection, so I think I'm the same login as far as SQL is concerned. So it shouldn't make any difference if I'm executing the script from VPME or the query window.

So there are no syntax errors in the string. Therefore, it must be something to do with my connection string from VPME, but what can it be?
.
Richard Stecenko
Interactive Computer Services Inc.
Victoria, British Columbia
204.453.2052
stecenko
 
Posts: 822
Joined: Mon Jun 21, 2010 8:06 pm
Location: Saanich, British Columbia

Re: Permissions create sql table

Postby stecenko » Thu Sep 10, 2015 1:23 pm

I found it. It has nothing to do with permissions.

In SQL Server Management, you can get it to create a script that shows you how an exiting table is created.

I based my VPME code on that script.

But, the script includes a 'GO' after every command. Like this...
USE [iTransformers]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

Using aerrors() I found that every GO was shown as syntax error. I just removed all the GOs from my sqlexec and all worked just fine.
Richard Stecenko
Interactive Computer Services Inc.
Victoria, British Columbia
204.453.2052
stecenko
 
Posts: 822
Joined: Mon Jun 21, 2010 8:06 pm
Location: Saanich, British Columbia


Return to VPM Enterprise 9.1 - Client Server

Who is online

Users browsing this forum: No registered users and 2 guests

cron