I need to migrate an existing project, built on the current beta of doctrine 2, from mysql to SQL Server.
I have complete control of the SQL Server.
In the DBAL Folder of Doctrine there already is a PDOMsSql driver, but I can't figure out, how to use it. (there is still no documentation)
Doctrine also offers two other ways, I could maybe use:
driverClass: Specifies a custom driver implementation if no 'driver' is specified. This allows the use of custom drivers that are not part of the Doctrine DBAL itself.
pdo: Specifies an existing PDO instance to use.
Could anyone help me with this? I have no clue how to start here, since I have no experience with ODBC/PDO and SQL Server at all.
I figured it out by myself... on a mac, "mssql.so" does only provide "dblib:" as a driver. So by replacing dbo_mssql in the Doctrine Driver with "dblib", defining a FreeTDS host and using its name as the hostname for my connection, everything works fine.
You can also use sqlsrv or pdosqlsrv now. I submitted changes to the pdosqlsrv driver in the Doctrine DBAL project today that fix some things with the DSN creation and get it working. Sqlsrv/pdosqlsrv is probably the way to go imo since Microsoft is actively developing it.
Related
I'm trying to configure the plugin dadbod (https://github.com/tpope/vim-dadbod) and must confess I don't know vimscript well enough to comprehend the code :(
I'm stuck on configuring the database adapters. Irrespective of what URL I try, I just get the message
DB: no adapter for SQL Server.
I've also tried SQLite and Postgres with the same results.
In the WIKI, there's a statement: Supports a modern array of backends - which makes me think I haven't configured "the backend" perhaps? I have the jdbc SQL Server driver installed, and set a JAVA_HOME environment variable which works fine with DBeaver and with Azure Data Studio.
I haven't been able to find anything on the web about how to configure dadbod beyond the command structure. Am I missing something obvious about how the plugin works?
Your help greatly appreciated!
The vim-dadbod plugin was definitely not installed correctly. I did a clean install of Vim, then installed the package manager Vundle. Following Vundle's instructions I was able to install vim-dadbod.
I'll be posting a followup later, but the issue is no longer the plugin itself!
I'm working currently on a windows form application which uses a Database, and i want to use MS SqlServer, now i need to know how to make it local based..
In other words : after publishing the app and install it on another device, it'll crash because of the database not found and the connection string also not right.
I've find on many threads a way to copy the md5 file from SqlServer directory to the project files and change the connection string to local, but it didn't work properly as it is still crashing on other devices, so what should i do in this case ?
Also is there any software i should install it on other devices in order to use sqlServer commands (like .Net Framework..etc), and also what is SqlServer Express ?, is it the thing i'm looking for ?
Please explain in details, Thanks in Advance.
I am using SQL Server Compact 4.0, so far so good
http://en.wikipedia.org/wiki/SQL_Server_Compact
Basically you need to create DB file and carry it over to destination machine with some additional assemblies.
You can download it from here:
http://www.microsoft.com/en-us/download/details.aspx?id=17876
There is also extension for Visual studio that allows you to work with it using designers. With it you can use Entity Framework which.
http://sqlcetoolbox.codeplex.com/
I've been doing php before but as usual,I used mysql as a database. So everything seems easy when using xampp.
Now, for some reason I am required to use Oracle as the database but after installing Oracle database 10g on my pc, I can't seem to start apache from the control panel at all! When I press start,instead of it being started it goes back to the stopped state. I tried making it a service and starting it from, it pops out an error.
What is making this conflict, I can use IIS to do this but I prefer xampp so I'm eager to make this thing work.
Does anyone know whats the conflict? Is it the port?
I know how to configure the oracle extension and all with php to get it to work, but I am just confused why apache can't be started when oracle db 10g is installed.
Hope someone can help me out.
I just had this problem with startup.pl not starting (according to the log files), so I went into xampp\apache\conf\httpd.conf and editted out this include line by putting a hash (or pound as it is called in the states) (#) in front of it:
Perl settings
Include "conf/extra/httpd-perl.conf"
it seems to work now and I have now got oracle and apache working on my machine.
Im not sure if there will be any problems later on because of removing the line, but I don't think I need to use anything perl related so hopefully it will be fine
Sounds like platform is Windows. Oracle has the habit to alter the PATH setting, system wide. There is also an Apache installation in the Oracle installation. Maybe you can tweak the Apache service to use the Oracle Apache installation. Otherwise, make sure that your Apache start service does not have ORACLE_HOME or sub-directories of ORACLE_HOME/bin in the PATH. The services that Oracle installs normally are not on the standard ports so it's not very likely that it is a port conflict.
I'm trying to connect my Ruby on Rails application to a legacy Database that is in a Microsoft SQL Server 2008. I have looked around different tutorials, pages, help pages, and question pages and still haven't been able to make it work.
I'm using:
Ubuntu karmic
Rails 2.3.5
Ruby 1.8.7
activerecord-odbc-adapter 2.0
activerecord-sqlserver-adapter 2.3
dbd-odbc 0.2.5
dbi 0.4.3
I also have installed:
freeTDS 0.82-6
tdsodbc 0.82-6
sqsh 2.1-8build1
libodbc-ruby1.8 0.9997-2 (have also tried with 0.9995 and 0.9998)
unixodbc 2.2.11-16ubuntu1
I have managed to connect to the database with tsql, sqsh and isql. But can't connect it through irb nor through rails. Whenever I try I get the following error:
DBI::DatabaseError: **INTERN (0) [RubyODBC]Cannot allocate SQLHENV**
from /var/lib/gems/1.8/gems/dbd-odbc-0.2.5/lib/dbd/odbc/driver.rb:36:in `connect'
from /usr/lib/ruby/1.8/dbi/handles/driver.rb:33:in `connect'
from /usr/lib/ruby/1.8/dbi.rb:142:in `connect'
from (irb):4
It doesn't really matter if I use the odbc-adapter or the sql-adapter, because it always fails in the dbi driver. Any ideas on what can be wrong?
I have the odbc.ini, odbcinst.ini and freetds.conf files properly defined. And they are working with all the other commands to connect (isql, tsql, sqsh).
Please help me or point me somewhere that might help me! =)
PS: I have already followed the following pages with not much success (among others):
wiki.rubyonrails.org/database-support/ms-sql?s[]=sql&s[]=server
piao-tech.blogspot.com/2008/02/using-activerecord-with-microsoft-sql.html
lambie.org/2008/02/28/connecting-to-an-mssql-database-from-ruby-on-ubuntu/
stackoverflow.com/questions/1419397/rubyodbc-cannot-allocate-sqlhenv
This page seems to suggest that the problem may be related to the inability to find a shared library. You should ensure that the system can find any libraries it may need by checking the output of ldconfig -v and ensuring that the folders containing libodbc, libodbcinst and libtdsodbc are included in the library search path. If you are not sure how to do this then this link may help.
If this fails then build the gem manually using the following line
ruby extconf.rb --with-odbc-dir=/folder/to/unixodbc --disable-dlopen
I can't swear that this is the correct answer but it may help. I do have freetds and SQL Server working quite happily with rails on Centos
If you can switch to JRuby ( jruby.org ) you can try using the active-record-jdbc gem with the MS SQL server JDBC driver. I use them to connect to a MS SQL Server 2005 database from Ruby and it works like a charm.
Hope it helps!
I've faced a bit strange problem. There is a site client would like to duplicate on another domain name. Site is built on ASP(yes, old v1 ASP :( ) with SQLServer. Problem is that all the database operations, including connection information is compiled into a DLL library.
Is there a way to some how intercept, override or workaround this?
Platform:
Windows 2000 Server
SQLServer 7
ASP v1 (VisualBasic)
What a nightmare...
If you have control over the new database server, and the connection string references the database server by name, you could add a line in the hosts file which points the name of the old server to a new ip address. Then you still have to create a user with the same password on the new database server.
Yes! However, your new database name MUST be smaller or equal to the length of your old one. Simply open up the vb6 .dll in any Hex Editor and search and replace. Make SURE you do not change the length of the DLL or shift any bytes around.
Failing that, add a hosts entry to windows to redirect the connection.
Could it be that the application uses a DSN definition for the connection?
In Control Panel -> Administrative Tools open ODBC Data Source Administrator. Have a look at the System DSN tab. Does there seem to be anything listed there that is related to the application?
Before you hack your DNS or rename the server, be aware that the SQL Server client supports aliases specifically for this scenario: How to: Create a Server Alias for Use by a Client.
The SQL 2000 tool for configuring an alias is the Client Network Utility.
Do you have any configuration options at all from asp? Even dbname or the such? If so you might be able to use two separate servers for IIS and use a single db server. I'm afraid you might need to find the source or the guy who wrote it.
If you could figure out the connection string or DNS you might be able to do something.
You could write your own passthrough ODBC provider.