473,387 Members | 1,398 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Sql server 2008 driver info

229 100+
Hi, I have this working fine from a mysql database. I am trying to use it from a sql server 2008 database but cannot get it working, just error 500. Does anyone know how the driver info might have to change or is there anything else in the code that might be mysql specific?
Thanks for any help in advance
Richard


the connection strung that works with my other pages is below but not sure how to adapt the mysql to it

gstrConnectToDatabase = "Provider=SQLOLEDB; Data Source=mssql2host.com; Initial Catalog=database; User ID=me; Password=passme"
Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. <%
  4. Set dataNow = Server.CreateObject("ADODB.Connection") 
  5. dataNow.Open("Driver={MySQL ODBC 3.51 Driver};Server=ms.host.com;DATABASE=test;USER=user;PASSWORD=1rich-TOP;OPTION=3")
  6. dataNow.execute("SET NAMES 'utf8'")
  7.  
  8. lastID = Request.QueryString("lastID")
  9. action = Request.QueryString("action")
  10. Set RS999=Server.CreateObject("ADODB.RecordSet")
  11.  
  12. 'We need to include the JS files and other standard HTML files here in order not to load them in every scroll.
  13. If action <> "getLastPosts" Then 
  14. %>
  15.     <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  16.     <html xmlns="http://www.w3.org/1999/xhtml">
  17.     <head>
  18.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  19.     <title>Untitled Document</title>
  20.     </head>
  21.     <link rel="stylesheet" href="css.css" type="text/css" />
  22.     <script type="text/javascript" src="jquery-1.2.6.pack.js"></script>
  23.  
  24.     <script type="text/javascript">
  25.     $(document).ready(function(){
  26.  
  27.         $('form#mainForm').bind('submit', function(e){
  28.             e.preventDefault();
  29.             checkForm();
  30.         });
  31.  
  32.         $('input#hostName').focus();
  33.  
  34.  
  35.         function lastPostFunc() 
  36.         { 
  37.             $('div#lastPostsLoader').html('<img src="bigLoader.gif">');
  38.             $.post("scroll.asp?action=getLastPosts&lastID="+$(".wrdLatest:last").attr("id"),
  39.  
  40.             function(data){
  41.                 if (data != "") {
  42.                 $(".wrdLatest:last").after(data);            
  43.                 }
  44.                 $('div#lastPostsLoader').empty();
  45.             });
  46.         };  
  47.  
  48.         $(window).scroll(function(){
  49.             if  ($(window).scrollTop() == $(document).height() - $(window).height()){
  50.                lastPostFunc();
  51.             }
  52.         }); 
  53.  
  54.     });
  55.     </script>
  56.  
  57.  
  58.     <body>
  59.  
  60. <%
  61.         'The content loaded when the page is first loaded start
  62.         SQL="SELECT * FROM test ORDER BY testID DESC LIMIT 20"
  63.         RS999.Open SQL,dataNOW,1,1
  64.         While Not RS999.EOF
  65. %>
  66.             <div class="wrdLatest" id="<%=RS999("testID")%>">
  67.                 <div class="xtop"><div class="xb1"></div><div class="xb2"></div><div class="xb3"></div><div class="xb4"></div></div>
  68.                 <div class="xboxcontent">
  69.                     <%=RS999("testName")%>
  70.                 </div>
  71.                 <div class="xbottom"><div class="xb4"></div><div class="xb3"></div><div class="xb2"></div><div class="xb1"></div></div>
  72.             </div>
  73.         <%
  74.         RS999.MoveNext
  75.         Wend
  76.         RS999.Close
  77.         'The content loaded when the page is first loaded end
  78.         %>
  79.  
  80.         <div id="lastPostsLoader">
  81.  
  82.     </body>
  83.     </html>
  84.  
  85. <%    
  86. Else
  87.     'When User Scrolls This Query Is Run Start
  88.     getPostsText = ""
  89.     SQL="SELECT * FROM test WHERE testID < "&lastID&" ORDER BY testID DESC LIMIT 5"
  90.     RS999.Open SQL,dataNOW,1,1
  91.     While Not RS999.EOF
  92.  
  93.         getPostsText = getPostsText & "<div class=""wrdLatest"" id=""" & RS999("testID") & """>"
  94.         getPostsText = getPostsText & "<div class=""xtop""><div class=""xb1""></div><div class=""xb2""></div><div class=""xb3""></div><div class=""xb4""></div></div>"
  95.         getPostsText = getPostsText & "<div class=""xboxcontent"">" & RS999("testName") & "</a></div>"
  96.         getPostsText = getPostsText & "<div class=""xbottom""><div class=""xb4""></div><div class=""xb3""></div><div class=""xb2""></div><div class=""xb1""></div></div></div>"
  97.  
  98.     RS999.MoveNext
  99.     Wend
  100.     RS999.Close
  101.     Response.Write getPostsText 'Writes The Result Of The Query
  102.     'When User Scrolls This Query Is Run End
  103. End If
  104. %>
  105.  
Dec 20 '12 #1

✓ answered by Rabbit

This page lists different connection strings for SQL Server 2008.
http://www.connectionstrings.com/sql-server-2008

4 2448
Rabbit
12,516 Expert Mod 8TB
This page lists different connection strings for SQL Server 2008.
http://www.connectionstrings.com/sql-server-2008
Dec 20 '12 #2
NeoPa
32,556 Expert Mod 16PB
I'm not sure you can determine which line the error occurred on Richard, but that is helpful if you have it and the text of the error message is also useful (and expected when posting a question relating to an error).

I expect Rabbit's link will prove helpful anyway, but please remember to include these items in your questions.
Dec 20 '12 #3
fran7
229 100+
Hi, Thanks for the replies, I found the connection string in the link you posted, thanks. I also found the error in the code is that "limit" is not supported in sql.
Thanks
Richard


Expand|Select|Wrap|Line Numbers
  1. Set dataNow = Server.CreateObject("ADODB.Connection")
  2. dataNow.Open("Provider=SQLNCLI10;Server=mss.com;Database=name;Uid=me;Pwd=me123;OPTION=3 ")
  3.  
Dec 20 '12 #4
Rabbit
12,516 Expert Mod 8TB
In SQL Server, you use top instead of limit. And in a different place.
Expand|Select|Wrap|Line Numbers
  1. select top 100 * from table
Dec 21 '12 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: prasath03 | last post by:
Hi, I am using Microsoft SQL Server 2000 Driver for JDBC to connect to SQL Sever 2000. It is just a test application whether its connect or not. But I got the following errors: Error is:...
1
by: =?Utf-8?B?bWFzYWtpeQ==?= | last post by:
Hello, I'm trying to develop 32-bit Windows Native C/C++ application using Visual Studio 2008, on 64-bit Windows Server 2008. Q1. Is it possible to develop 32-bit C/C++ application using VS 2008...
2
by: Michael Richard | last post by:
Hi, I need a help from you. I'm writing device driver for 64 bit Windows Server 2008. I have code for 32 bit Windows Server 2008, its working fine on 32 bit. I need a help to port from 32 bit...
0
by: =?Utf-8?B?Tml0cmFt?= | last post by:
I have searched almost everywhere to find this info, but have not read it anywhere. Can I use Web Server 2008 if the only thing it does is to host a bunch of .PDFs for people to look at from the...
1
by: Chris O'C | last post by:
See: http://blogs.zdnet.com/microsoft/?p=1519 "Microsoft officials announced at TechEd South Africa on August 6 that SQL Server 2008 has been released to manufacturing. "Microsoft officials...
1
by: =?Utf-8?B?QW50amU=?= | last post by:
I need product keys for Terminal Server Windows Server 2008 access (CALs) under MSDN - TSLM Service said they cannot provide product keys for the access.
6
by: AAaron123 | last post by:
I need to move a database from sql server 2008 to sql express 2008. Will backing up the sql server 2008 database to a file and then using that file to restore to sql express 2008 work? I don't...
1
by: BobLewiston | last post by:
I installed SQL Server 2008 Express, basic edition (SQLEXPR32_x86_ENU_Bootstrapper.exe, version 9.0.30729.1) without any problem. Then I attempted to install AdventureWorks Sample Databases for...
0
by: IT Couple | last post by:
Hi 1) Question one I'm installing SQL Server 2008 Enterprise Edition on Windowds XP (remotely) and in the 'readme' file it tells me to install SP1 first and then SQL Server 2008 but when I try to...
0
by: Bhavesh Patel | last post by:
hi we have installed virtual sound driver in windows server 2008, but still not play our voice files in windows server 2008, we havn't physical audio device in our server. anybudy have idea for...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.