I have a Quickbooks POS database which is a SAP SQL database. I am trying to use a odbc driver QODBC that is supposed to access the database but something is wrong with my database. A quickbooks provided database test connection utility log gives the following error:

Login procedure 'sp_login_environment' caused SQLSTATE '52W09' Procedure 'sp_login_environment' not found

I have contacted Quickbooks POS tech support but they say they cant help. Any ideas would be greatly appreciated.

asked 18 Sep, 08:09

SSmith's gravatar image

SSmith
26113
accept rate: 0%


(chances are, someone's futzed around inside your database, which may be the reason Quickbooks folks are taking a hands-off attitude... but really, they're the ones who created the database so they should support it.)

Since you are using ODBC, you probably don't need sp_login_environment at all; run this command in ISQL to disable it:

SET OPTION PUBLIC.login_procedure = NULL;

Alternatively...

This is the default login procedure setup for a new empty SQL Anywhere 17.0.9.4803 database (which AFAIK is the same for all earlier versions):

CREATE PROCEDURE "dbo"."sp_tsql_environment"()
begin
  if "db_property"('IQStore') = 'Off' then
    set temporary option "close_on_endtrans" = 'OFF'
  end if;
  set temporary option "ansinull" = 'OFF';
  set temporary option "tsql_variables" = 'ON';
  set temporary option "ansi_blanks" = 'ON';
  set temporary option "chained" = 'OFF';
  set temporary option "quoted_identifier" = 'OFF';
  set temporary option "allow_nulls_by_default" = 'OFF';
  set temporary option "on_tsql_error" = 'CONTINUE';
  set temporary option "isolation_level" = '1';
  set temporary option "date_format" = 'YYYY-MM-DD';
  set temporary option "timestamp_format" = 'YYYY-MM-DD HH:NN:SS.SSS';
  set temporary option "time_format" = 'HH:NN:SS.SSS';
  set temporary option "date_order" = 'MDY';
  set temporary option "escape_character" = 'OFF'
end;

CREATE PROCEDURE "dbo"."sp_login_environment"()
begin
  if "connection_property"('CommProtocol') = 'TDS' then
    call "dbo"."sp_tsql_environment"()
  end if
end;

SET OPTION PUBLIC.login_procedure='sp_login_environment';

You could try running all those commands in ISQL to see if they restore anything's that missing.

You could also try running this command to see if the "dbo." qualification helps:

SET OPTION PUBLIC.login_procedure='dbo.sp_login_environment';
permanent link

answered 18 Sep, 16:34

Breck%20Carter's gravatar image

Breck Carter
28.1k477639917
accept rate: 20%

edited 18 Sep, 16:37

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×42

question asked: 18 Sep, 08:09

question was seen: 522 times

last updated: 18 Sep, 16:37