I am currently trying to connect to a database using an ODBC Alias to SQL Server. The problem I'm having is that when I use my TQuery object to get the information it always requests login details (nevermind whether I've specified them in the ODBC creation). I don't mind manually setting them in the code, but I can't find how to do that.
The most common solution I've found is to use the database component and go through that. However that comes with its own issues. Due to my dataset being so large and the database component converting the dataset to a Paradox table I keep getting a BDE error of 'Temporary Table Resource Limit'.
I don't get this error if I ignore the database component (which is fine) however this leaves me with the login prompt issue. Has anyone found a way to bypass this for TQuerys without swapping to other connection paths such as ADO?
Disabling the login prompt without using the TDatabase bypass
1.8k Views Asked by gn12345 At
1
There are 1 best solutions below
Related Questions in DELPHI
- How can I read the header of request to webserver
- Receiving Notifications for Individual Task Completion OmniThreadLibrary Parallel.ForEach
- Delphi - How to get result of function from QuickReport without viewing a report?
- Out of memory while adding documents to a Firebird BLOB field with Delphi
- How to MakeScreenshot fullpage on Delphi
- How to program a COM object with an IEnumerator, IEnumerable interface inside
- How to Dynamically Add Controls to Delphi Form
- How to write a string in Stringrid with DelimitedText in FMX Delphi 11
- TGrid/TStringGrid multi cell selection / multi editing in delphi firemonkey (12)
- How to localize "Today" in the Delphi TMonthCalendar?
- How can I call a SOAP webserver method in Vue.js?
- Efficiently Handling Large Number of API Calls with Delphi 10.4 and OmniThreadLibrary
- Delphi can not compile the unit create by its "XML Data Binding Wizard"
- Save Form Properties in File and then restore those Properties after reopening
- Is it possible to open a blob without saving it to file
Related Questions in ODBC
- Snowflake ODBC xdg-open Missing X server or $DISPLAY
- Stata + ODBC driver requires login too often
- mysql with odbc to ms access - runtime error 3146 (odbc call failed)
- Informix Golang client package
- Access won't open past the splash screen
- Can't make sense why ConnectionError: Data source name not found and no default driver specified
- Issue interacting via dbplyr with remote SQL tables probably since odbc or DBI or dbplyr package update
- CentOS/RHEL download dependencies
- Error connecting to SQL Server using pyodbc: Data source name not found and no default driver specified
- How to Implement Multi-Parameter Queries in SSRS Report Builder with Databricks ODBC?
- C++ Poco ODBC issue with setting char type in sql
- Firbird DB multiple connections problem using BDE+ODBC connection
- SQL Server configuration giving [ODBC Driver 17 for SQL Server TCP Provider: Error code 0x2746
- connecting to postgres using ODBC windows with gssencmode not working
- Providex ODBC CONCAT issue
Related Questions in DELPHI-5
- change order of labels being printed in QuickReport Delphi
- GetFileVersionInfo returning incorrect fileVersion for SQLOLEDB.dll
- Stop generating QuickReport in a bandBeforePrint Event in Delphi 5
- Delphi 5 transparency breaks child draw
- Erasing canvas area in old Delphi
- Borland Delphi 5 and 7: exceptions stop to work
- How to avoid having to restart Delphi 32-bit application after it fails with a "memory allocation failure" on Database failover?
- How to load a bitmap, with background color, into a TImageList in Delphi 5?
- Get output of all dcu files in delphi 5
- An inexplicable error class error in my application
- Delphi 5 - Round down to 4 decimal places anomaly
- Run the same Delphi app on two machines, one immediately returns "Resource TfrmHSMain not found", the other runs fine
- SQL Statement in Delphi throwing "missing semi-colon" error
- "Low Bound Exceeds High Bound" error in Delphi 10
- Create XML document using MSXML2_TLB
Related Questions in BDE
- Firbird DB multiple connections problem using BDE+ODBC connection
- Migrating from BDE to FireDac: Strange FireDac behaviour with Interbase and automatic transactions
- BDE installer for Delphi 12
- Delphi BDE with connection to Oracle access violation
- Connecting legacy c++ application with BDE(borland database engine) to Oracle 19 enterprise
- "Another user changed the record" error not raised after conversion from BDE to FireDAC
- Cannot get result from tQuery after success connected to SQL Server 2019 Express from my old Delphi 7 (using BDE and SQL Server as Driver Name)
- Moving data from BDE Paradox Database to SQLite FireDAC Database
- Borland _qsqXXXX.dbf files, what controls the location, insufficient space error
- Where is BDE for Delphi 10.4 Sydney
- How to run Borland Database Engine in Docker?
- Setting DateTime format in Delphi with Firedac compatible with BDE Application
- BDE Borland link with SQL Server database
- How to use BDE dbiDoRestructure to add fields in Delphi 10.4?
- BDE dbidorestructure returns empty table
Related Questions in TQUERY
- C# has something similar to TQuery in Delphi?
- Cannot get result from tQuery after success connected to SQL Server 2019 Express from my old Delphi 7 (using BDE and SQL Server as Driver Name)
- Delphi TQuery result set - how to avoid the caveats of having RequestLive set to true
- Delphi and Oracle - Cannot access field "TRANSACTIONS" in a filter
- Render IP CAMERA stream with three.js
- How To Increment Numbers in Calculated field of TQuery?
- Delphi XE10, can't edit field values of an empty TQuery
- unusual record count in TQuery.Record count
- TEdit and TQuery
- Disabling the login prompt without using the TDatabase bypass
- How can I query a value in SQL Server TEXT column that contains XML (not xml column type)
- Is Query.Close necessary after Query.ExecSQL?
- How to get Physijs and Threejs to work together with tQuery
- How to display tQuery.World in a canvas HTML5
- Retrieve datename from SQL on DELPHI
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I'm a bit rusty with the BDE but I don't think there's an easy way to avoid the login prompt if what you're saying is that you're not using a TDatabase component in your project.
The reason is that when you attempt to open your TQuery without a TDatabase (or TSession) component in your project, the default Session object in your app will call the routine below from within your TQuery's OpenCursor:
As you can see, if the session can't find an existing TDatabase component with the right name, it creates a temporary one, and it's the call to Result.Open that pops up the login prompt, without, so far as I can see, giving you any opportunity to supply the password + user name before the pop-up (the Session's OnPassword doesn't seem to get called in the course of this).
Obviously you need to check using the debugger that that's what's happening in your app, a temporary TDatabase being created, I mean.
If what I've suggested in the Update below didn't work and I were desperate to avoid using a TDatabase component, I would look into the possibility of maybe deriving a TQuery descendant, and trying to override its OpenCursor to see if I could jam in the user name/password.
Anyway, seeing as you say you're not using an explicit TDatabase, if I understand you correctly, because of the "Temporary Table ..." issue, and seeing as the Session will create a temporary one anyway, I suppose it might be worth your while investigating why the temporary one doesn't provoke the "Temporary Table" error, whereas using a TDatabase component in your app evidently does. Idapi32.Cfg configuration issue, maybe? At the moment, I can't help you with that because I can't reproduce your "Temporary Table" error, despite using my TQuery to do a SELECT on a SqlServer table to return 250,000+ rows.
Oh, that's a point: Does your table contain any BLOBs? I seem to recall there's an Idapi config parameter that lets you reduce the temporary storage space the BDE uses for BLOBs (to zero, maybe, but it's been a long time since I used the BDE "for real").
Update: The thought just occurred to me that since your query seems to work with Session dynamically creating a TDatabase object, maybe it would also work with a TDatabase which you dynamically create yourself. I just tried the following, and it works for me:
+1 for an interesting question, btw.