EOF Returned For OConn.OpenSchema( AdSchemaForeignKeys ) On SQL Server 2K
Environment: Windows XP Pro, IIS 5, SQL Server 2000
oConnectionString = 'driver={SQL
Server};server=(local);uid=sa;pwd=;database=mydata base;'
Relationships are setup on all the tables.
EOF is returned for the recordset when using:
oRecordSet = oConnection.OpenSchema( adSchemaForeignKeys )
This works when using an Access2000 database, but not for SQL Server 2000.
What's wrong?
Set rsSchema = objConn.OpenSchema(adSchemaTables) Do Until rsSchema.EOF If rsSchema.Fields("TABLE_TYPE") = "TABLE" Then Response.Write rsSchema.Fields("TABLE_NAME") & "<br />" End If rsSchema.MoveNext Loop rsSchema.Close set rsSchema = Nothing
just a simple example of what i'm trying to do. its supposed to list the names of all the tables in the database, but instead its returning the following error:
ADODB.Connection error '800a0cb3'
Object or provider is not capable of performing requested operation.
I am using MSAccess 2003 as my DB, ASP page my front end. My access file is in the temp folder which ahs IUSR_Machine permissions. My asp page works fine, connects to DB and retrieves what I want. Now, when I open my db file in Microsoft Access in Exclusive mode my ASP page doest establish a connection which is correct as exclusive open locks the files and prevents further connections. Upto here no problem.
Now when I close that opened Microsoft Access instance, my web page resumes working. If I refresh it, it works. The third time I refresh the page I get "Unspecified Error". Again if I refresh it works and again if I refresh I get "Unspecified error" when I debugged it fails at connection open. Code:
How is it possible to execute an exe from asp and get a returned string (no http headers in exe) ?
To run exe I use : <% cmdExe = sPath & "cgi-bin equest.exe" Set WshShell = Server.CreateObject("WScript.Shell") sResult = WshShell.Run(cmdExe, 1, True) Set WshShell = Nothing
Response.write sResult %>
sResult always content "0" and not the string returned by exe file (something like "!!-1!blabla!blablablabla!")
- How is it possible to get the exe returned value ? - Is there a solution with asp.net ?
When I do a query that I know has 2 rows, I get rs.recordcount equals -1. Same thing when it's just one row. I need something that gives me the number of rows.
I am trying to update a record but it returns this error :
Error Type: Microsoft OLE DB Provider for ODBC Drivers (0x80004005) [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'Function'. /performaindia/security/functionssys.asp, line 210
Now at line 210, I have this function : rs.Update.
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot insert the value NULL into column 'SystemUserOnly', table 'performaindia.dbo.SecurityTableFields'; column does not allow nulls. INSERT fails.
/performaindia/security/tablefields.asp, line 220
now the line 220 is an update statement : rs.Update
I have a bit of a situation here, I own a job board and have multi-posting comapnies posting jobs to our database and we have returned values going back to them to tell them if the job vacancy was posted succesfully or not.
The problem I have is that our main ASP guru is of sick and the other is off away on business. I have pretty good knowledge of ASP but not as much as these guys. So I need to know how to send a response back to the posting company whether it has been succesfull in posting the job vacancy instead of sending back a page back displaying whether it was successful.
I define a recordset with a pagesize of 100 in my COM object and return this recordset to ASP. When I check my pagesize at the ASP level,it is 10 I assume this is the default.
I can set my pagesize at the ASP level after the COM function is called, but I would prefer to have this encapsulated within the COM.
I am not sure what way to do this, i want a specific row returned and displayed in asp but not in a text box, in acess and vb i ahve done this and its just a label but not sure in asp.
I have an ASP/ADO application querying an SQL Server DB. I want know the most efficient way to determine if more than one row is returned from a query. If more than one row is returned, the user will be presented with a choice of which row to process. If only one row is returned, I want to skip this stage, and process that single row immediately.
I can think of a number of ways of acheiving this (eg. .recordcount) but I'm looking for the slickest and most efficient method.
wondering if its possible to have some kind of searched word highlight! IE. every thing it throws up in return of search it will highlight why it has brought it up! so if search "a" all "a" in return results would be highlighted.
I've got a DropDownlist with predefined numbers(5,10,15,20 etc.) which I want to do a postback to the GridView pagesize, so that the user manually can change returned rows. Is there a way to do that in the properties of the Designview or must there be a code behind. If so, what is the code for this?
I am retrieving a response from another site but certain special characters such as ' (single quote) or "(double quote) and £ (pound sign are being returned as ?. The code i am using to get the page is as follows:
I'm currently developing on IIS 5, ASP 3 and MySQL 4.1 using the latest ODBC driver from MySQL.
Any time field I have return from the database is returned as the current date. I've tried every table which has a date, created tables which soley keep records on the date.
I've submitted the date from MySQL Query browser using CURRENT_TIME and from an ASP page. Both submit fine.
I've returned the record using a Recordset to move through each and filled an array using GetRows().
// displaying the returned results Do While (Not objRS.EOF << spit out records >> objRS.MoveNext Loop
Now, is there an instance of objRS I can call that will just display how many records were returned? I tried objRS.Count on a longshot, but that didn't work
I have an ASP report that returns values from a SQL database and formats the data in an HTML table.
I am trying to figure out a good way of using CSS to highlight the table row that contains the highest value returned.
I tried storing the values in an array, and then used a function to find the highest value. This worked, but then I couldn't really figure out how to "tell" the report to highlight that highest value.
I need to be able to do a search (postcode) from a list of around 2500 addresses. I would like to create a temp table and for the returned recordset to be in a random order, until that is the user requests to sort by say Name, Address etc...
The order initially needs to be random because I do not want the same 'top' addresses appearing for the same postcodes...
I thought I could in the temp table assign a sort order column and then place a random number in it. If I choose a large random number range then the likelihood that the same record has the same number is low...
I have created a simple search engine which retrieves records from an access database using sql and displays them using ASP.How do I go about counting the number of records that have been retrieved?
why a ADO recordset.recordcount would return a -1? I have confirmed that it has records in it by writing some values to the screen. Why can't I count the number of records returned though?
I have this on my asp page SELECT * FROM company WHERE comName LIKE '*Tech*' If I run it against Access then it returns a few records but within my ASP page, no record is returned. Why and how to fix it?
The problem is I am now having to limit the number of rows that it returns:
Alldata = rs.Getrows(300)
Now my NumRows always equals 300 no matter how many matches are found so my counter doesn't work. Does anyone know a way around this?I know that I can use SELECT COUNT(*)..... instead in an SQL query but that means making two trips to the server which I don't really want to do.
I am looking for a simple way to limit the amount of letters/Characters returned so that it does not throw off my pages styling. Basically I have the following: Code:
<% Dim SomeVariable response.write(SomeVariable) %>
If that SomeVariable has 300 characters in it it will create a very large table that it displays in so, what I want to do is limit it to say 25 or 50 Characters and simply put like .... after it. Any Ideas?
Please help me in finding the code for reading the Return parameter value from an Oracle stored procedure through an ASP page. I need a javascript code for doing that.
Please friends it would be of great help if i get the exact code since my project is stuck up bcoz of this.
I've created a Stored Procedure which adds a new record and updates some more records and then returns the primary key for the added record.
The SP seems to work OK, but I'm having problems getting at the returned key in my ASP code:
"Item cannot be found in the collection corresponding to the requested name or ordinal."
A common error, but in this case I can't see why... I output the SQL instruction that is sent to the DB and have run it in Query Analyser and it runs OK and returns a single row, with a single column - the new primary key...
But when I try and access this in ASP, I get the error message....
I have an ASP search script that interfaces with microsoft indexing service that is shown in the header on all of my pages. My pages are pure div & table layout. Is there any way to load the asp search results into a table in a specific cell?
I am looking to return the first 50 characters from a database field. Does anyone know if there is a SQL function that returns a defined amount of characters from a database field?
I've been trying to find a simple way to count the records returned from a database query short of looping through the recordset and incrementing a counter.
I've tried the following without any success:
Ubound(select_rs) - afterall the recordset is returned in an array right? Ubound gives the following error: Microsoft VBScript runtime (0x800A000D) Type mismatch
I've tried select_rs.count which gives the following error: VBScript runtime (0x800A01B6)
Basically, I've reached the point where I think I may have to loop through the recordset and count the number of records returned. Seems like an awfully inefficent way to do something so simple.
I have a stored procedure, which receives 3 parameters and returns a record set. Now if i pass a wrong id, or different checks in the stored procedure fail my record set does not open Here is the code: