Logon failed, Crystal Reports 9, VB6 , sql server, sqlncli - vb6

i'm trying to build a setup package for a legacy vb6 software. the software itself connects to a sql server via sqlncli (native client). i've packaged all the dependencies and deploy them to a new machine running winxp and office2003.
now, from the target machine i can connect to the database (ms sqlserver 2005) that is running somewhere else using tcp/ip. the legacy software connects to the db just fine and i can manipulate data. but when i try to open a crystal report, things get messy:
i get an error saying "Run-time error '-2147189176(80047e48): Logon failed.
Details: 01000:[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect())"
since the reports where designed on a different system, different db and what not ... there is a loop before calling the report that resets the db-information for every table :
For i= 1 To numTables
Set crTable = crTables.Item(i)
crTable.SetLogOnInfo dbServer, dbName, dbLogin, dbPasswd
Next
the ConnectBufferString reads "Connection String=DRIVER=SQL Server;;User ID=user;;Password=;;Database=MY_DB;;Server=192.168.1.3\SQLEXPRESS;;UseDSNProperties=-1"
there doesn't seem to be a way to explicitly set the provider to SQLNCLI, at least i don't see any.
when running the software on my dev-system everything works like it's supposed to.
i hope you guys can help me out with this.
just so we don't have to argue about this : i also think both these technologies (vb6 and cr9) are outdated, but switching is not an option here.

You need to wipe the tables and change the configuration of access to the database, see the example below.
In the first line of code I put an example if necessary to change the connection driver, in my case the report was pointing to a PostgreSQL database and programativamente needed change to connect to a SQL SERVER.
myReportObject.Database.Tables(1).DllName = "crdb_ado.dll" 'Connect to SQL with OLEDB
For Index = 1 To myReportObject.Database.Tables.Count
With myReportObject.Database.Tables(Index)
.ConnectionProperties.DeleteAll
.ConnectionProperties.Add "Provider", "SQLOLEDB"
.ConnectionProperties.Add "Data Source", mySqlIP
.ConnectionProperties.Add "Initial Catalog", myDB
.ConnectionProperties.Add "User ID", usr_id
.ConnectionProperties.Add "Password", pass
.ConnectionProperties.Add "Integrated Security", 0
End With
Next

I know you said in your comment that you've got around this already, but I figured I'd throw this out there. :)
You may try using
Provider = SQLNCLI
instead of,
DRIVER = SQL Server
to see if that makes a difference.
Take a look at the following link. Scroll down on the page until you see the "SQL Native Client 9.0 OLE DB provider" section. They show examples of connections strings using the SQL Server Native Client.
http://www.connectionstrings.com/sql-server-2005
Hope this helps.

Related

How to replicate existing OracleRDB ODBC connection in Oracle's SQL Developer application?

I am new to Oracle database in general, but I'm attempting to get Oracle's SQL Developer running on a workstation that has pre-configured System DSNs created for an OracleRDB database. I've confirmed the ODBC connections are working because I can use MS Access to connect and link to the tables. The "test" options within ODBC also succeed. Now I am trying to get a similar connection created using SQL Developer so I can see the column types and write queries in a more useful editor.
Here's what I have available when examining the ODBC connection properties:
Now I'm trying to create a duplicate connection in SQL Developer, but I'm at a loss for why things don't work. I first tried using the default SQL Developer installation, but couldn't get things working. Then I discovered there's an OracleRDB extension available, so I installed that, but I keep getting this error when attempting to use similar values:
As I stated, these ODBC connections were pre-configured on the workstation I'm using, so I don't know anything more than what is provided by the Oracle ODBC driver window.
Is there something obvious I'm not seeing or doing to replicate this connection in SQL Developer? Or perhaps something else I can do to debug this to learn more?
UPDATE
On the advice of one answer I'm trying to make the connection with JDBC, but having a hard time understanding what I'm doing wrong. Here's another screenshot with the connection parameters I have available, but with the server and database names changed:
With these values (the port came from my tnsnames.ora file), if I try to make a JDBC connection I keep getting the following error from SQL Developer:
One final attempt I did was to use the proper values in the Oracle RDB tab, and when I use them and click 'test' the Testing Connection dialog just spins and never seems to return:
So I apologize for the long post here, but I'm struggling because there's just something I am really not understanding about how this all works. I appreciate everyone who took the time to read this question.
Oracle SQL Developer is a Java Application. You'll need to get the JDBC Driver for RDB.
Once you have that, in the SQL Developer preferences, find the Third Party JDBC section, and then use that to add an entry and point to the JAR for what you just installed.
Step by step instructions here.
Working connection string for RDB Thin Driver:
RDB_DB_CONN_STR = "jdbc:rdbThin://node.myplace.com:1707/";
where node.myplace.com is the name of the OpenVMS node hosting the RDB Thin Driver, 1707 is the port number assigned to the RDB Thin Driver.

OLEDB, ODBC, Ntext and Nvarchar(max)

I understand that Microsoft decided back in 2011 to deprecate OLE DB and that no new drivers or maintenance would occur beyond SQL Native Client V11. In future you should use ODBC based drivers - http://weblogs.sqlteam.com/dang/archive/2011/09/04/rip-ole-db.aspx
The latest ODBC driver being 'Microsoft ODBC Driver 13 for SQL Server' release on 25th July 2016 - https://www.microsoft.com/en-us/download/details.aspx?id=50420
ODBC drivers from Native Client V9,10,11 and the Microsoft ODBC Driver SQL Server V11 and 13 all work in Classic ASP code interacting with SQL server (I am using SQL 2012) except for one problem - nText and Nvarchar(max).
They just return blank - I have seen solutions saying you should read into a local variable first rather than addressing the recordset directly e.g. varStr=rs("LargeText"), but that does not work for me. And there is other mentions of using get chunk etc.
But I am quite happily using Native Client V9 (Provider=SQLNCLI) which works perfectly with these data types.
So, my questions are:
Is there anyway to get ODBC drivers working with nText/Nvarchar(max) datatypes?
Is there any benefit to using ODBC over OLEDB?
Do I have to upgade to ODBC at some stage in order to connect to SQL server in future i.e. SQL 2014/2016?
In other words, can I just carry on using OLEDB going forward?
OK, Lankymart - I would use something like this:
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Driver={SQL Server Native Client 11.0};Server=*Yourserver*;Database=*YourDatabase*;User ID=*YourUserid*;Password=*YourPassword*;"
'oConn.Open "Provider=SQLNCLI11;Server=*YourServer*; Database=*YourDatabase*;User ID=*YourUserID*;Password=*YourPassword*;"
set view=oConn.Execute("SELECT [PText] FROM [TextTest]")
ttext=view("PText")
response.write(ttext)
view.Close
set view = Nothing
oConn.Close
set oConn = Nothing
Where [PText] is an NVARCHAR(Max) field in SQL. This does not work using the native client ODBC ({SQL Server Native Client 11.0}) but will work using OLE DB (SQLNCLI11).
Did you tried to use driver={SQL Server};...? It works for me but with a issue. You need to read into a local variable because if you tried to use it again it will return null.
See the code below:
Print rs!varcharmaxVariable 'Returns ok
Print rs!varcharmaxVariable 'Returns null
...
You can change the field size from varchar(MAX) to a set size. If you cannot change the size in the database, you can cast your select statement and it will work with ODBC Driver 13.

Issue with Oracle ODBC

I have a server with an Oracle Database. Using Navicat I can connect to the Database and see the database tables, run queries etc.
I am trying to add ODBC support for Oracle to be used with Crystal Reports.
What I have done so far:
I struggled to install instant client and get it working as shown in some guides. As suggested I downloaded ODAC which bundled on the Oracle ODBC Driver and Instant Client etc.
After installing I had Oracle installed in C:\app\Administrator\product\12.1.0\client_1
I added two Environmental Variable:
%ORACLE_HOME% to go to C:\app\Administrator\product\12.1.0\client_1
%TNS_ADMIN% - to go to C:\app\Administrator\product\12.1.0\client_1\Network\Admin
Once added, I then went to control panel->Administrative Tools->ODBC.
I clicked system DSN and added the connection. The connection was successful.
However, when selecting the ODBC connection via Crystal Reports, the Database is showing the database functions (I assume stored functions as they appear in the functions section for the DB in Navicat). I cannot however, see the actual database tables.
Has anyone else experienced this issue and if so does anyone know how to resolve this. Many thanks for your time

Linking Oracle tables to Access 2007 File (Performance)

I'm running into a problem while linking some tables and views present on a Oracle 11g database to a Access 2007 file.
I'm using the Oracle Client (SQORA32.DLL) version 11.02.00.03.
If the view/table returns a small amount of data, there's no problem. The problem happens when the view or the table returns a "large" amount of data. I've tried to increase the buffer size on the driver (default is 64000) to see if that happens. I've also removed the "Enable query timeout" option - otherwise I would get a "Query cancelled by user" or a "ODBC - Call Failed" error.
In order to link the tables/views, I've used the "native tool" (External Data -> ODBC Database -> Link to data source by creating a linked table).
I was wondering if I could retrieve the data from the tables/views using vba. Sometimes, I (you should read "I" as "the users") may need to update data on some tables (control tables).
Please let me know your thoughts.
EDIT: Our goal with this project was to migrate from SQL Server 2005 to Oracle 11gR2. After analyzing the behaviour of the Access files regarding the SQL Server, I've concluded that the results are showing like a "cursor" - if you scroll down on the result window, it will load more.
I think that this may be the issue because, AFAIK, Oracle (driver, maybe?) pulls everything from the DB and, only then, populates MS Access.
It's a long time after this so here goes the solution. MS access has a flag for the ODBC connection as "Treat Float as Numeric". This have made the trick.

Issue with Oracle Client Data Source in SQL Server 2012 SSIS

I am having an issue with Oracle connectivity from an SSIS project, and have been Googling around to try to find a solution for over a week, now, and haven't found anything.
I have the following configuration in my dev environment:
O/S: Windows Server 2008 R2 Datacenter, 64-bit
SQL Server Data Tools, 2010
I need to configure an SSIS Data Flow Task to pull data from four different Oracle Data Sources (among others). One is Oracle version 11.1.0.7, two are version 9.2.0.4.0 and one is 9.2.0.8.0.
We use local TNSNAMES and SQLNET.ora files for our configuration.
I have tried this with many different Oracle clients, and basically get the same result, so will highlight one that I did:
Installed the Oracle Client 11gR2 64 bit.
Installed the Oracle Client 11gR2 32 bit (that order is recommended).
Copied my TNSNAMES and SQLNET.ora files into both network/admin configuration folders.
Did a successful TNSPING on each of the 4 databases named above. Successful.
Opened up SQL Server Data Tools and opened a new project
Did a "Create new Connection Manager", picked ADO.NET
Selected "Oracle Client Data Provider", enter the details of the 11g database
Did a "test Connection". Success.
Repeat the procedure for one of the 9.0 databases. When I do the "Test Connection" I get a "Test Connection failed because of an error in initializing provider. ORA-12645: Parameter does not exist".
I get this same result for all three of the 9.x databases.
Oracle "help" says that this error is caused by a missing parameter in the SQLNET.ora file, and that the solution is to add the missing parameter. Trouble is, nowhere does it say what is missing.
I have tried this same procedure with other Oracle client installs other than the two clients - ODTwithODAC1120320_32 bit, ODAC1120320_x64 and get exactly the same result. I can't go to a version 12 client because as I understand it, it won't work with a 9 database. I can't go to a 10 client because that won't work with an 11 database.
I have a feeling that it's very specific to the 64-bit O/S and version of SQL server, but that is our target platform, so need to make it work.
Can anyone help me with this, please?

Resources