cancel
Showing results for 
Search instead for 
Did you mean: 

ODBC connect problems for SAPDB 7.4.3

Former Member
0 Kudos

Hello,

after i successfully installed a SAPDB (7.4.3) server and created a database instance (Demo Database "Small", created with the Database Manager GUI) i'm now in trouble with connection to the database from C# via ODBC.

SAP DB ODBC Driver was installed by the server setup (profile "all"). I created a ODBC data source (SAP DB) called "SAPDB", Database "Small" and left Server emtpy because it's the same host. So far i think this should be correct.

Now i created a C# Project in VS2005:


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.Odbc;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace SAPDB_Connector
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnConnect_Click(object sender, EventArgs e)
        {
            string strConn = "DSN=SAPDB;UID=DBA;PWD=admin";
            IDbConnection conn = new OdbcConnection(strConn);

            conn.Open();

            IDbCommand cmd = conn.CreateCommand();
            cmd.CommandText = "SELECT owner,tablename,type,tabletype FROM tables";

            IDataReader reader = cmd.ExecuteReader();

            try
            {
                while (reader.Read())
                {
                    int n = reader.FieldCount;
                    MessageBox.Show("Got something!!", "Yeah", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            finally
            {
                reader.Close();
                conn.Close();
            }
        }
    }
}

Via the SQL Studio i can connect to the database "Small" with user "DBA" an password "admin", so i'm trying this here to. But at "conn.Open();" i get the following error:

ERROR [28000] [SAP AG][SQLOD32 DLL][SAP DB] Invalid authorization specification;-4008 POS(1) Unknown user name/password combination

Why? There is no wrong or unknown username /password combinatin because this login is working with SQL Studio.

Any ideas??

Greetings

Michael

Edited by: Michael Hilgers on Jan 30, 2008 9:23 AM

Accepted Solutions (1)

Accepted Solutions (1)

Melanie
Advisor
Advisor
0 Kudos

Hi Michael,

please try the password in uppercase: ADMIN.

HTH, Melanie

Former Member
0 Kudos

Ahhh, you're right. Thx!!!

Former Member
0 Kudos

Good am everyone. Anyone who can help me. I'am new in this forum and SAP. Pleas help me to my problem. Why I can't run my MaxDB? I'm receiving this error :

"Can not create the FileSystemObject from the Microsoft Scripting runtime library (scrrun.dll)."

"Error 429: ActiveX component can't create object"

Another thing. What should I pu or type in SERVER NAME in SAP DB SQL STUDIO.

Thank you for your time answering.

Thanks,

Dexter

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

it seems that your SQL Studio installation failed. What Windows version do you use? Can you reinstall it and close all other programs during installation.

The server name is the name/ip of the database computer. If you work locally you can leave it blank.

Regards

Wolfgang