Finding size of a database field
I am writing in C++ using Visual Studio 2015. The program question takes data from a user and stores parts of his input as text fields in an Access database. I want to know the capacity of the database field: say it’s TEXT(75), I will warn the user if the data submitted for stage in that field exceeds 75 characters. I have a class generated from the table, is there any way, if I open either the table class, or the underlying database, I can use a C++ function on one of the classes to tell me the size. As if I were doing:
long max=database(“databasename”).table(“tablename”)
.field(“stringfieldname”).GetMaxSize();
Re: Finding size of a database field
What are you using to access the database? ADO, MFC ODBC classes, something else?
Re: Finding size of a database field
Re: Finding size of a database field
Then have a look at the CRecordset::GetODBCFieldInfo method.
Re: Finding size of a database field
Thank you. Problem solved!
Re: Finding size of a database field
You are welcome! :)
You can now could mark the thread as "resolved" and, perhaps, share the solution! ;)