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 to not load all database records in my TListbox in Firemonkey Delphi XE8
- How to catch WM_DEVICECHANGE in a control other than TForm?
- show information with Rolling / moving messages delphi xe7
- What is the different between "Console target" and "GUI target" in DCC32 option?
- How to add new online ressources to RAD Studio help system
- C# and Delphi code have different behaviour when importing unmanaged dll
- Loop through records on a cxgrid and update a field/column
- Delphi 7 - Save to a Specific .INI Files Name
- TImagelist for large images
- how to modify a function so it returns an array of strings
- Checking for internet connection in runtime
- How can I make the main form align correctly after my control height is autosized and then I maximize the form?
- fetch data from web service to dataset in Delphi
- Load candlestick data from file
- Infinite loop in parsing a string using pointer math
Related Questions in ODBC
- microsoft odbc driver manager data source name not found and no default driver specified
- Edit fields in local table linked to PassThrough Query
- Using an ODBC connection in Access get retrieve data from DB2
- IIS7 SQL ODBC and Server 2008 R2 (converted site from IIS6 2003 to 2008 R2 IIS7)
- Microsoft Access connection to MYOB ODBC developer mode
- RODBC on an Oracle Database and special characters
- How to configure DNS for microsoft odbc driver for oracle (in 64 bit arch.)
- How to refresh linked tables if Access disconnects from MySQL database server?
- Cannot insert data over Linked Server into Redshift
- New Datastax driver for Tableau is not working
- C++ [ODBC]-MSSQLExpress 2008 SQLSTATE: 28000 || 42000
- ODBC with FreeTDS PHP Not working via HTTP
- "Unable to find the requested .Net Framework Data Provider", MySQL. tried using odbc too
- How to extract and store ODBC with driver pairs
- c# Tableadapter fails to update through odbc
Related Questions in DELPHI-5
- Connect to database via FileDSN in Delphi
- Disabling the login prompt without using the TDatabase bypass
- Layout control that is supported woth Delphi 5?
- OLE automation: How to check if a variant references an automation object
- How to set System Restore points in Win8
- Delphi Exe throws Exception code: 0xc0000005 only on Windows 7 64 Bit
- Delphi 5 Strange result when sum double variables
- Tchart, weird plotting when zooming
- Delphi Component: How to use parent font?
- Correct way of retrieving a longint field from a SQL Server table in Delphi 5
- Use Delphi5 in Delphi XE environment
- How to capture and save to file from webcam using DSPack and Delphi 5
- Resize png image in Delphi - incorrect alpha channel
- Why is a Currency variable treated as a constant with FillChar in Delphi?
- Saving RTM files compatible to previous versions of Report Builder
Related Questions in BDE
- Connect to database via FileDSN in Delphi
- How can I use one query with more then one table and one dbgrid
- Disabling the login prompt without using the TDatabase bypass
- How can I get an Interbase password if I have only the BDE alias?
- Help with Parameterized Query (using Delphi 7 and BDE)
- Determining best method to traverse a table and update another table
- applications shares same BDE
- BDE says "Field not found" but field exists
- Look for tables in a subdirectory
- Delphi BDE PostgreSQL query execution (syntax error)
- Record Has Been Changed By Another User when try to Post or Edit
- Stored procedure Text saving in Delphi
- "Another user changed the record" error not raised after conversion from BDE to FireDAC
- How to find out what permission an application needs under Windows 7
- Data-aware controls are "empty" after closing, reopening datasets and TDatabase
Related Questions in TQUERY
- Disabling the login prompt without using the TDatabase bypass
- Help with Parameterized Query (using Delphi 7 and BDE)
- Delphi and Oracle - Cannot access field "TRANSACTIONS" in a filter
- Delphi - Using different TTable and TQuery as one object
- Delphi TQuery save to csv file
- How to ignore some parameters in TQuery
- How to extract a set of records with a specific field from a Delphi in-memory data table
- How to display tQuery.World in a canvas HTML5
- TEdit and TQuery
- Delphi TQuery result set - how to avoid the caveats of having RequestLive set to true
- tQuery event handler on cube
- How to use HTML5 Web Audio API to record my voice
- Query optimization in Delphi 4
- Need to create tql queries
- Delphi XE10, can't edit field values of an empty TQuery
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 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.