Datasnap / dbExpress deployment issues - mysql

I'm playing around with setting up a Datasnap server on IIS at the moment.
I have managed to get the default Datasnap / Javascript demo to work, and have extended it to include my own string based results to a version of the webpage.
However I am being stumped moving to the next level.
I want to add in a database module and return results from a MySQL database accessed via dbExpress.
As soon as I add a datamodule with a TSQLConnection and TSQLQuery on it and roll out the compiled dll the server stops working. Remove the Datamodule and recompile and everything is fine.
I've tried adding the libmysql.dll and dbxmysql.dll to the website root and adding them to the ISAPI restriction list to allow them to run, but I'm obviously missing something else.
Update
Following some more testing the core issue is with adding an extra datamodule for the TSQLConnection & TSQLQuery. If I include these on the TServerMethods1 unit then the app works...

Dan, insert MidasLib in your USES clause, better than deploying another dll, this will keep everything you need in your executable.

Related

duplicate objects in sql server

This is a long story and I am a little bit stack, I have tried many things and I was able to move forward, question is what now?
This is the full story:
I started working in a .net core project, 2.1. I installed for that visual studio 2019 and other tools. The important thing is that I installed SQL Server 2017 developers edition (the free one) with the default parameters, that version created an instance called MSSQLServer. Unfortunately, the project needed a different instance name which was MSSQL2017, so I tried to change the name of the instance, I couldn't because it is a free version, reinstalling it did not work either and a few other things that I tried, the important one is that a colleague changed the default sql string to make it compatible with my installation, in order to see if the problem was the setup or something else. It worked, and the tables and database was created for that project. So I managed to create another instance calling it with the proper name MSSQL2017, created the users and so on. When I go to Ms SQL Server Manager Studio, I notice that the tables are not created, so I run profile and run the project again, and this is what I get 'Cannot insert duplicate key row in object 'sys.syssingleobjrefs' with unique index 'clst'. The duplicate key value is (67439, 76, 101).' and that's when I am lost, I can't find what sys.syssingleobjrefs refers to so I have no idea how to move on to fix this mess. Any help?
update: so sys.syssingleobjrefs is a system base table, that I can't see its content, how do I modify it?
select * from sys.syssingleobjrefs does not work
syssingleobjrefs is a system table accessible only through Administrator mode.
You have to use sqlcmd -A in order to access this table.
https://learn.microsoft.com/en-us/sql/relational-databases/system-tables/system-base-tables?view=sql-server-ver15

Using directive for package added in Visual Studio Code

I'm trying trying to build a web app with ASP.NET Core 3.0 and using VS Code to do it. Moreover, I'm using MySQL for my database, and this is where things are getting rough. It seems like there's very little support out there for this particular combination of VS Code and MySQL.
I can't find any tutorials with this particular combination, so I can't figure out how to put it all together. I ran the dotnet add package Mysql command, which installed the package, and I see that it's been added to the .csproj file, except now I don't know how to make use of it in my Model file. I'm trying to find the using directive for it, but I can't find any posts on any forums addressing this issue.

Squirrel: UnityJDBC throwing ClassNotFoundException

I've using Squirrel SQL 3.6.
I have working connections to two databases, which I'll call A and B. I can run queries against A and B without issues. They've been setup and working for a couple years.
I'm needing to run queries against both of these datasources/connections and have Squirrel handle the joins between them.
I've got the UnityJDBC driver added. I've created a connection using same. The next step is to add A and B to it, such that I can run queries across them.
I open the connection, right-click and select "(Virtualization) Add Source" and select A from the list, then tell it to "Add." I don't add any other properties.
It tells me:
Preparing to add data source...
ClassNotFoundException for Driver: com.ibm.as400.access.AS400JDBCDriver
Make sure driver is in your classpath.
If that driver wasn't in the classpath, I'm assuming I wouldn't be able to use connection A at all. Which leads me to believe UnityJDBC has another classpath all its own. Any suggestions on what that would be, where to find it, how to fix this, etc?
As said in this instruction http://www.unityjdbc.com/squirrel/MultiSourceVirtualizationPlugin_install.pdf :
Make sure to add other database JDBC jars into the squirrel/lib folder
or JRE classpath. The plugin cannot access drivers in custom
classpaths used by SQuirreL.
Hope it's not too late and helps ;)

Stop EF Database Initialization for DefaultMembershipProvider

Team, I have an ASP.NET MVC application that I'm deploying. When I deploy it the application works fine, but when I call Membership.CreateUser it ends up trying to create the database even though it already exists. What do I need to do to get it so that it will not try to call CreateMembershipEntities since the database already exists?
I've tried Database.SetInitializer to an initializer that does nothing, I've tried removing the defaultConnectionFactory in the Web.config - I'm currently out of options.
I look forward to your help!
UPDATE
I just found out yesterday that the reason it's trying to create the database is because the hosts servers do not allow the connection to query sysdatabases and so the database never exists and is hence always trying to create it. It appears that I may have to go back to the old fashioned AspNet membership provider and also go away from the EF code first model.
give a look here: http://www.qualitydata.com/learn/web-config-membership-provider-settings
It shows the Membership configuration section of the web.config. You have to write a similar section and put connectionStringName="Your Connection String". In your connection string you specify the informations of the already existing database.

Subsonic 3.0.0.3 with MySQL 4template is not working

I am ready and see all the tutorials and videos to configure the subsonic 3.0.0.3 with MySql and fail to genarate the ActiveRecords.cs. I use the MySQL.ttinclude in the folder to generate the class but it is still not working. I rename all the refenreces to SQLServer.ttinclude to MySQL.ttinclude and it still does not work. The error is: Metadata file "MySql.Data" could not by found.
I really need to use the subsonic version 3.0.0.3 with MySql 5.1.
I ran into the same issue. Make sure you actually run the installer for the MySQL connector as that put everything in the GAC. I tried to get it to work by just adding the ref to MySql.Data, and I got the same error as you. Everything worked perfectly once I ran their install.
Yes, all reference is setting. The two dlls Subsonic.core.dll and MySql.Data.dll. I think that's probable a bug int the 4templates for MySql. Many people still have problems whit the version for MySql. In the videos of rob for configurin and setting MySQL generate, it still work perfectly, but the files in the pack 3.0.0.3 are different.
dunno if you got same problem but i had trouble and it was because i had a C# project but was using the VB templates and it never created the files, also i have used mysql connector 6.1 if this helps as i think this is the most compatable version when it comes to stuff like this.
Yes, Iam using MySQL Connector 6.1 whit provider. Now I try to generate my class with the 4Templates to LINQ, but I don't have success. I see this error in VStudio 2008
Warning 1 Multiple template directives were found in the template. All but the first one will be ignored. Multiple parameters to the template directive should be specified within one template directive.
When I try to generate the class with the templates for Active Record, It's works, wonderfull, but I realy need the LINQ templates class generated.