|
-
February 17th, 2017, 03:34 PM
#1
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();
-
February 18th, 2017, 09:11 AM
#2
Re: Finding size of a database field
What are you using to access the database? ADO, MFC ODBC classes, something else?
Victor Nijegorodov
-
February 18th, 2017, 10:08 AM
#3
Re: Finding size of a database field
-
February 18th, 2017, 10:34 AM
#4
Re: Finding size of a database field
Then have a look at the CRecordset::GetODBCFieldInfo method.
Victor Nijegorodov
-
February 18th, 2017, 11:24 AM
#5
Re: Finding size of a database field
Thank you. Problem solved!
-
February 18th, 2017, 12:47 PM
#6
Re: Finding size of a database field
You are welcome! 
You can now could mark the thread as "resolved" and, perhaps, share the solution!
Victor Nijegorodov
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|