Thursday, July 4, 2013

[SQL Server] Struggling to change an Access Connection string to MS SQL Server

[SQL Server] Struggling to change an Access Connection string to MS SQL Server


Struggling to change an Access Connection string to MS SQL Server

Posted: 03 Jul 2013 05:53 PM PDT

Hi there,I have an evaluation application that I am trying to configer to use SQL server instead of the built in Access database.I have created and set up all the tables and fields on the SQL server, but cannot get the database functionality to connect and work correctly.The string this is used for the Access DB is as follows:[quote]Function OpenDB Dim Conn ' Connect the database Set Conn = Server.CreateObject("ADODB.Connection") Conn.Provider = "Microsoft.Jet.OLEDB.4.0" Conn.Open Server.MapPath("dbname.mdb") Set OpenDB = Conn End Function[/quote]For SQL server, the string is usually very different, like:[quote]Conn = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=username;pwd=password;Initial Catalog=MyDatabse;Data Source=ServerName"[/quote]How and where can I make changes to this string, so that I can get things to work with SQL Server, rather than with Access?Many thanksHans

How to sum in a bigint instead of an int

Posted: 04 Jul 2013 08:25 AM PDT

I have a Query, where I SELECT SUM(A.MINUTES) from....The variable A.minutes is defined as an INTProblem is, that I now and Again gets an aritmic overflow here, because sum(A.Minutes) can be pretty hugeSo, How to get the sum into an BIGINT instead.To change 'A.Minutes' to BIGINT is not an option unfortunatelyBest regardsEdvard Korsbæk

No comments:

Post a Comment

Search This Blog