Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Hoyas
Starting Member
8 Posts |
Posted - 2004-03-22 : 15:35:52
|
I get this error message (0x80040E21)ODBC driver does not support the requested propertiesHere is the source codeSQLs= "EXECUTE crosstab 'Questionnaire', 'User_Id', 'Id', 'convert(varchar,Question_Id)', 'Answer_Id'" Set objRecordset1 = objConnection.Execute(SQLs) If objRecordset1.EOF=False And objRecordset1.BOF=False Then SQLs="SELECT Users.Id": w=" WHERE 1=1": p1="(100-(" : k=0 For i=1 To objRecordset1.Fields.Count-1 n="##q1." & objRecordset1.Fields(i).Name w=w & " AND " & n & ">=0" : p1=p1 & " +sign(ABS(" j=1 : While Not objRecordset.EOF If j=i Then p1=p1 & n & "-" & objRecordset("Answer_Id") & " AND " objRecordset.MoveNext : j=j+1 WEnd objRecordset.MoveFirst p1=Left(p1, Len(p1)-5) & "))" k=k+1 Next If k>0 Then p1=p1 & ")/" & CStr(k) & "*100)" p=", " & p1 & " AS P" SQLs=SQLs & p & _ ", Users.Login, Users.FirstName, Users.LastName, Users.Sex, Users.BirthDate, Users.EMail, Countries.Country, Users.Online" & _ " FROM ##q1, Users, Countries " & w & _ " AND ##q1.Id=Users.Id AND Users.Type=1 AND Countries.Id=Users.Location AND " & p1 & ">0" SQLs=SQLs & " ORDER BY " & p1 & " DESC, Users.Online" Else SQLs=BAD_SQL End If Else SQLs=BAD_SQL End If objRecordset1.Close Page=1 Session("User_MatchMe_SQL")=SQLs Else Page=CLng(Request.Form("MatchMePage")) SQLs=Session("User_MatchMe_SQL") End If Set objRecordset1 = CreateObject("ADODB.Recordset") objRecordset1.PageSize = ROWS_IN_PAGE objRecordset1.Open SQLs, objConnection, 1I have the same code in the other place at my project, and it works perfectly, but not in this case. Tried everything - no luck.Please, helpThanksnath |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-03-22 : 15:40:08
|
If you pull the query out of your code and put it into Query Analyzer, does it work there?Tara |
|
|
Hoyas
Starting Member
8 Posts |
Posted - 2004-03-22 : 15:49:54
|
Yep, works perfectly in a query analyzer |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-03-22 : 15:53:03
|
Are you running the latest ODBC driver on that machine? How about MDAC?Why are you even using ODBC? OLE DB is the way to go now.Tara |
|
|
Hoyas
Starting Member
8 Posts |
Posted - 2004-03-22 : 16:11:35
|
I didn't write the code, just making some changes on existing code. have the latest MDAC and i think the latest driver, but not sure. |
|
|
|
|
|
|
|