fernandobatels / rsfbclient

Rust Firebird Client
MIT License
74 stars 10 forks source link

sql error -923 when I try connecting to db. #145

Closed DmitryNX closed 11 months ago

DmitryNX commented 1 year ago

I get the next error: sql error -923 Connection rejected by remote interface

I have the next code: OS: Windows 10

Cargo.toml

[dependencies]
rsfbclient = { version = "0.23.0", default_features = false, features = ["dynamic_loading"] }

main.rs

fn connect() -> Result<(), FbError> {
    let mut conn = rsfbclient::builder_native()
        .with_dyn_load("./fbclient.dll")
        .with_remote()
        .host("localhost")
        .db_name("D:/awesome.fdb")
        .user("SYSDBA")
        .pass("masterkey")
        .connect()?;

    // ...
}
fernandobatels commented 1 year ago

This sounds like a firebird configuration issue.

Please, check:

DmitryNX commented 1 year ago

I have checked all your points, but it didn`t give me any success.

But I did not say You that my task is connecting to InterBase. Also I noticed, from time to time, my code works perfectly and I get a result. And, finally, I want to say it is possible to connect to InterBase by Firebird client (for example in C++/Qt there is plugin IBASE to do it).

Is it probably some mistakes in the crate?

fernandobatels commented 1 year ago

Is it probably some mistakes in the crate?

Maybe, but I'm going to need some reproducible situation.

Can you share your project code or an example that build and reproduce your problem?

DmitryNX commented 1 year ago

A minimal example:

Cargo.toml

[dependencies]
rsfbclient = { version = "0.23.0", default_features = false, features = ["dynamic_loading"] }

main.rs

use rsfbclient::{FbError, Queryable};

fn main() -> Result<(), FbError> {
    let mut conn = rsfbclient::builder_native()
        .with_dyn_load("./fbclient.dll")
        .with_remote()
        .host("localhost")
        .port(3050)
        .db_name("D:\\awesome.fdb")
        .user("SYSDBA")
        .pass("masterkey")
        .connect()?;      

    let response: Vec<(String,)> = conn.query("SELECT * FROM my_table", ())?;

    println!("Rows count: {}", response.len());

    Ok(())
}

When I call the connect() function I catch the error, also I notice in firebird.log file at this moment the next error:

INET/inet_error: read errno = 10054

If I try using Firebird server instead Firebase server then I take the next error:

Error unsupported on-disk structure for file D:\\awesome.fdb found 13.1, support 12.0
fernandobatels commented 1 year ago

Please, provide your firebird/firebase version.

DmitryNX commented 1 year ago

Please, provide your firebird/firebase version.

Firebird 3 Firebase 2009

fernandobatels commented 1 year ago

But I did not say You that my task is connecting to InterBase.

I think that the fbclient is not full compatible with interbase in some versions.

If I try using Firebird server instead Firebase server then I take the next error: Error unsupported on-disk structure for file D:\awesome.fdb found 13.1, support 12.0

Please, try use a full firebird 3 environment, with server, dll and fdb on firebird 3. Maybe your fdb file was generated on interbase or with a old version of firebird.