Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9170969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:05:58+00:00 2026-06-17T16:05:58+00:00

I have some legacy ODBC connection coding which uses the SQLGetInfo function to gather

  • 0

I have some legacy ODBC connection coding which uses the SQLGetInfo function to gather various connection details when requested. The code is currently being re-factored to .NET, however it still has to maintain a small amount backward compatibility until the remaining areas are also re-factored into .NET

I need to be able to reproduce the follow c++ code using c# OdbcConnection.GetSchema()

char strInstanceName[200];
SQLSMALLINT lengthReturned;
SQLGetInfo(myhInstance, SQL_SERVER_NAME, strInstanceName, 200, &lengthReturned);

char strDSN[200];
SQLSMALLINT lengthReturned;
SQLGetInfo(myhInstance, SQL_DATA_SOURCE_NAME, strDSN, 200, &lengthReturned);

char strActiveStmts[200];
SQLSMALLINT lengthReturned;
SQLGetInfo(myhInstance, SQL_ACTIVE_STATEMENTS, strActiveStmts, 200, &lengthReturned);

char strActiveConns[200];
SQLSMALLINT lengthReturned;
SQLGetInfo(myhInstance, SQL_ACTIVE_CONNECTIONS, strActiveConns, 200, &lengthReturned);

I’ve spent hours looking over the documentation and searching the web, but I’m unable to find or understand what the equivalent is using OdbcConnection.GetSchema(), even though the documentation and web lead me to believe this is the function to get all this information.

Example code would be nice 🙂

Regards
DIG’s

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:05:59+00:00Added an answer on June 17, 2026 at 4:05 pm

    Answered via the MSDN forum.

    Basically the info I require isnt obtianable through the .NET framework, I need to call the ODBC API directly in c# using InteropServices and DllImport.

    http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/4579ccbc-4977-493e-a863-94ecdfe181b4/#9d74fc73-7be9-482b-b6db-1b4c256cb355

    DIG’s

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to integrate some legacy 32-bit code - for which I don't have
I have some legacy code that uses Interlocked.Equals to compare values. The values may
Currently I have some legacy ASP.NET 2.0 code that uses the ASP Xml web
I have some legacy ASP.NET WebForms code that uses RegisterClientScriptInclude in a class that
I have some legacy Java code inside which I'd like to call a groovy
I have some (legacy embedded c) code which produces a .csv file by means
I have some legacy code with a legacy function that takes a filename as
I have some 'legacy' code (which I can't change, but need to add on
I have some legacy code that uses shmget/shmat/shmdt to create, attach and manage shared
I have some legacy Fortran code which I'm recompiling using the latest Intel compiler

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.