Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 21 total
Thread ADO.Net & VS 2005
Tue, Feb 14 2006 10:11 AMPermanent Link

Joao Araujo
Hello,

 I am trying to access a local database using the following command :

 conn = new OdbcConnection(
          @"
          DSN=APP;
          DRIVER={C:\dbisam\odbc\trial\ver4\lib\dbodbc\ro\dbodbc.dll};
          StrictChangeDetection=False;
          RemotePort=12005;
          RemoteCompression=0;
          CatalogName=C:\dbisam\taxhouse;
          ForceBufferFlush=False;
          ReadOnly=False;
          LockWaitTime=100;
          RemoteReadAhead=50;
          LockRetryCount=15;
          RemoteIPAddress=127.0.0.1;
          ConnectionType=Local"
       );               


 Unfortunately, I receive the following error when I try to open the connection. ;


                'conn.ServerVersion' threw an exception of type
'System.InvalidOperationException'

 As you see am using the trial version, together with VS2005.
 The database I am accessing is version 4, according to the EMS Manager I use to access
the database.

 What should be causing this error?


 BTW, my database is version 4, not 3. If I dont state this perfectly when
 using the number I get encrypted tables.



Thanks in advance,
Tue, Feb 14 2006 1:54 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Joao,

<< I am trying to access a local database using the following command: >>

It could be the DRIVER connection item.  When specifying a DSN, you don't
need the DRIVER connection item.  Even so, it should be specified as
follows, not with a full path:

conn = new OdbcConnection("DRIVER={DBISAM 4 ODBC Driver};
StrictChangeDetection=False; RemotePort=12005; RemoteCompression=0;
CatalogName=C:\dbisam\taxhouse; ForceBufferFlush=False; ReadOnly=False;
LockWaitTime=100; RemoteReadAhead=50; LockRetryCount=15;
RemoteIPAddress=127.0.0.1; ConnectionType=Local");

--
Tim Young
Elevate Software
www.elevatesoft.com

Tue, Feb 14 2006 4:34 PMPermanent Link

Joao Araujo
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Joao,

<< I am trying to access a local database using the following command: >>

> It could be the DRIVER connection item.  When specifying a DSN, you don't
> need the DRIVER connection item.  Even so, it should be specified as
>  follows, not with a full path:
>..........

That's what I am using.

conn = new OdbcConnection(
      @"DSN={DMSDB};
           DRIVER={DBISAM 4 ODBC Driver};
           StrictChangeDetection=False;
           CatalogName=C:\dbisam\taxhouse;
           ForceBufferFlush=False;
           ReadOnly=false;
           RemotePort=12005;
           RemoteCompression=0;
           LockWaitTime=100;
           RemoteReadAhead=50;
           LockRetryCount=15;
           RemoteIPAddress=127.0.0.1;
           ConnectionType=Local"


 Unfortunately,  still does not work.
 I  still face the same error.


 1. Why do I need the remote info if my database is local?
 2. I dont have a database server. Just the directory, anyway, the manager can access the
directory.
 3. Dont you have a ADO api?  I found one on the internet dont know if it works for local
files, or just remote.
     they said it comes from your company.
     http://www.contextsoft.com/products/dbisamnet/ordering.jsp
    (I am trying to use it , but as far as I know it just work for remote server)
   
 4. I dont need the server as I am using just the files. I also dont want to buy it
     now. The customer uses a software that access DBISAM . This software does
     not use a server as well.




 More detail about my conf.

 1. ) Everything is configured on the ODBC manager as (DBMSDB)
       anyway I am still using the configuration above.
 2) I tried with and without the DSN info.

 3) I am using plain ODBC connection



Joao,




Attachments:
Wed, Feb 15 2006 2:00 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Joao,

<< That's what I am using.  >>

No, you're not.  You shouldn't include the DRIVER connection item if you're
specifying the DSN.  The DSN already knows which driver it is using.  Let's
start with something more basic.  Does this work for you ?

conn = new OdbcConnection("DSN=DMSDB");

(Notice that you don't put brackets around the DSN connection item)

<< 1. Why do I need the remote info if my database is local? >>

You don't.  Just leave it out.  You could get away with this:

conn = new OdbcConnection("DRIVER={DBISAM 4 ODBC
Driver};CatalogName=c:\mydata");

<< 3. Dont you have a ADO api? >>

No, because at the moment it is unnecessary with the ODBC support in .NET.
The ODBC driver is unmanaged, and so would a DBISAM ADO.NET data provider
that provided local access.   IOW, there would be no difference between the
two.

<< I found one on the internet dont know if it works for local files, or
just remote. they said it comes from your company.  >>

I doubt it they said that exactly.  They are a separate company and they
handle the support for their ADO.NET data provider.

<< (I am trying to use it , but as far as I know it just work for remote
server) >>

Yes, it does.

<< 4. I dont need the server as I am using just the files. I also dont want
to buy it now. The customer uses a software that access DBISAM . This
software does not use a server as well. >>

Just to be clear - you shouldn't be using the trial version for anything
other than evaluation.  If you use it for actual work, you (or the customer)
should purchase a copy of the driver.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Feb 15 2006 2:34 PMPermanent Link

Joao Araujo
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Joao,

<< That's what I am using.  >>

No, you're not.  You shouldn't include the DRIVER connection item if you're
specifying the DSN.  The DSN already knows which driver it is using.  Let's
start with something more basic.  Does this work for you ?

conn = new OdbcConnection("DSN=DMSDB");

(Notice that you don't put brackets around the DSN connection item)

<< 1. Why do I need the remote info if my database is local? >>

You don't.  Just leave it out.  You could get away with this:

conn = new OdbcConnection("DRIVER={DBISAM 4 ODBC
Driver};CatalogName=c:\mydata");

<< 3. Dont you have a ADO api? >>

No, because at the moment it is unnecessary with the ODBC support in .NET.
The ODBC driver is unmanaged, and so would a DBISAM ADO.NET data provider
that provided local access.   IOW, there would be no difference between the
two.

<< I found one on the internet dont know if it works for local files, or
just remote. they said it comes from your company.  >>

I doubt it they said that exactly.  They are a separate company and they
handle the support for their ADO.NET data provider.

<< (I am trying to use it , but as far as I know it just work for remote
server) >>

Yes, it does.

<< 4. I dont need the server as I am using just the files. I also dont want
to buy it now. The customer uses a software that access DBISAM . This
software does not use a server as well. >>

Just to be clear - you shouldn't be using the trial version for anything
other than evaluation.  If you use it for actual work, you (or the customer)
should purchase a copy of the driver.

--
Tim Young
Elevate Software
www.elevatesoft.com

Wed, Feb 15 2006 3:24 PMPermanent Link

Joao Araujo
>> No, you're not.  You shouldn't include the DRIVER connection item if you're
>>specifying the DSN.  The DSN already knows which driver it is using.  Let's
>>start with something more basic.  Does this work for you ?

>conn = new OdbcConnection("DSN=DMSDB");

(Notice that you don't put brackets around the DSN connection item)

sorry, Whatever I do It does not work. I've tried many configurations,
including yours. I am doing this just in case it a driver connstring misreading.

It keeps on reporting :
ServerVersion = 'conn.ServerVersion' threw an exception of type
'System.InvalidOperationException'

StackTrace = "   at System.Data.ProviderBase.DbConnectionClosed.get_ServerVersion()\r\n  
at System.Data.Odbc.OdbcConnection.get_ServerVersion()"

((System.Exception)(conn.ServerVersion)).StackTrace

<< 3. Dont you have a ADO api? >>

<Nor, because at the moment it is unnecessary with the ODBC support in .NET.
<The ODBC driver is unmanaged, and so would a DBISAM ADO.NET data provider
<that provided local access.   IOW, there would be no difference between the
<two.

Yes you right .
<<< I found one on the internet dont know if it works for local files, or
<<<just remote. they said it comes from your company.  >>

<<I doubt it they said that exactly.  They are a separate company and they
<<handle the support for their ADO.NET data provider.

  I misread the faq. my fault.
<< (I am trying to use it , but as far as I know it just work for remote
<<server) >>

<Yes, it does.

I 've put it to work in 30 minutes, using the server.



I think I will beforced to buy two products. The ADO api from
contextsoft  works really great and fast.

Sorry, but Could not put yours to work. This damned "Server Version"
comment keeps on showing up. I infer it is the database that I have.

I am ready to buy the product, but, if I find something better on the net
I will jump to it.



Joao,
Thu, Feb 16 2006 4:43 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Joao,

<< sorry, Whatever I do It does not work. I've tried many configurations,
including yours. I am doing this just in case it a driver connstring
misreading. >>

Please post the connection string that you are trying.

<< It keeps on reporting :
ServerVersion = 'conn.ServerVersion' threw an exception of type
'System.InvalidOperationException' >>

Are you referencing the ODBCConnection.ServerVersion property in your code ?

<< Sorry, but Could not put yours to work. This damned "Server Version"
comment keeps on showing up. I infer it is the database that I have. >>

Can you send me one of the tables that you're trying to access ?  Basically,
something is wrong with what you're doing.  DBISAM's ODBC driver works just
fine with VS 2005.

--
Tim Young
Elevate Software
www.elevatesoft.com

Thu, Feb 16 2006 9:21 PMPermanent Link

Joao Araujo
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Joao,

<Please post the connection string that you are trying.
   Here is some of  the code that I tried. and Also the one from
   ADO.net  that works.

    public DmsDALC(DBConnectionInfo connection)
       {
           connectionInfo = connection;
          //  conn = new OdbcConnection("DRIVER={DBISAM 4 ODBC
Driver};CatalogName=c:\taxhouse");            
           conn = new OdbcConnection(
           @"
                       DRIVER={DBISAM 4 ODBC Driver};
                       catalogName=c:\taxhouse;
                       ForceBufferFlush=False;
                       ReadOnly=false;
                       LockWaitTime=100;
                       LockRetryCount=15;
                       ConnectionType=local"
        );                

           //conn = new DbisamConnection();
           //conn.UserId = "Admin";
           //conn.Password = "DBAdmin";
           //conn.Host = "127.000.000.001";
           //conn.Port = 12005;
           //conn.ChangeDatabase("TaxhouseDB");
           //conn.EngineVersion = "4";
           //Cursor.Current = Cursors.WaitCursor;
           //conn.Open();

           //Cursor.Current = Cursors.Default;
       }
<< It keeps on reporting :
<< ServerVersion = 'conn.ServerVersion' threw an exception of type
<<'System.InvalidOperationException' >>

<Are you referencing the ODBCConnection.ServerVersion property in your code ?
No not even tried.

<< Sorry, but Could not put yours to work. This damned "Server Version"
<<comment keeps on showing up. I infer it is the database that I have. >>

<Can you send me one of the tables that you're trying to access ?  Basically,
<something is wrong with what you're doing.  DBISAM's ODBC driver works just
< fine with VS 2005.

There are three tables attached.
Tell me if you need something else.

Thanks for your help,

Joao Araujo,


--
Tim Young
Elevate Software
www.elevatesoft.com




Attachments: taxhouse.zip
Fri, Feb 17 2006 11:45 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Joao,

<< Here is some of  the code that I tried. and Also the one from ADO.net
that works.

This one should work, provided that you escape the backslash.  You shouldn't
even be able to compile the connection string as you typed it without
escaping the backslash:

conn = new OdbcConnection("DRIVER={DBISAM 4 ODBC
Driver};CatalogName=c:\\taxhouse");

This one most likely will not due to the ampersand.  BTW, where does the
ampersand (@) keep coming from in your connection strings ?

           conn = new OdbcConnection(
           @"
                       DRIVER={DBISAM 4 ODBC Driver};
                       catalogName=c:\taxhouse;
                       ForceBufferFlush=False;
                       ReadOnly=false;
                       LockWaitTime=100;
                       LockRetryCount=15;
                       ConnectionType=local"
        );

--
Tim Young
Elevate Software
www.elevatesoft.com

Sat, Feb 18 2006 12:08 AMPermanent Link

joao araujoo
"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote:

Joao,



>This one should work, provided that you escape the backslash.  You shouldn't
>even be able to compile the connection string as you typed it without
>escaping the backslash:

>conn = new OdbcConnection("DRIVER={DBISAM 4 ODBC
>Driver};CatalogName=c:\\taxhouse");

>This one most likely will not due to the ampersand.  BTW, where does the
>ampersand (@) keep coming from in your connection strings ?


The at sign(@) is used by CSharp to accomplish an automatic scape for all
backslashs in the string, besides other uses. It makes my s, tring exactly like
yours. Actually, I was just trying to play here and there to see if I could find
any error beyond the OdbcConnection.

I've tried more then hundred configurations without success. Just to make sure,
I tried exactly the way you mentioned above... same error. Ive tried with different
ODBC manager configurations (File DSN, User DSN, System DSN), I ve even monitored
the system to see if I could point out some error... Nothing found.

I've tried yours configuration just in case, I wanted to make sure, I did not commited any
other mistakes because of so many tests.  I could turn blind to some simple mistake.



I advice you to test your drive with the files I sent you. I am pretty sure you wont be able
to connect. You will have more elements to point out the error anyway.

Joao Araujo

Page 1 of 3Next Page »
Jump to Page:  1 2 3
Image