jp
 Beginner Join Date: 3/2/2009 Posts: 15
|
|
|
Posted: 3/2/2009 10:23:38 AM
|
|
|
Hi,
I'm trying to migrate my website from my local development machine (running SQLEXPRESS) to my live web host (running SQLServer 2005.)
Let me give some background:
On my development machine: 1) I installed successfully using SQLEXPRESS 2) I set my database string key in web.config as instructed 3) The database string specified my existing database, userid, and password 4) The database setup went fine 5) I went looking for the DMG tables and discovered they were in the MASTER database, not the one I had setup in the database string. Go figure.
On my live production web hosted machine: 1) I set my database string key in web.config as instructed 2) The database string specified my existing database at my web host; it's SQLServer 2005. I gave the database string my userid/password as provided by the web host. 3) I ran the install 4) It failed, but it was my fault... I had to move the DLL files to my root website bin folder 5) I re-ran the install and got this error:
ERROR: There was a SQL error during setup. View the error message below and then Click Here to try again.
System.Data.Odbc.OdbcException: ERROR [42S22] [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'NAME'. ERROR [42S22] [Microsoft][ODBC SQL Server Driver][SQL Server]Invalid column name 'NAME'. at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader, Object[] methodArguments, SQL_API odbcApiMethod) at System.Data.Odbc.OdbcCommand.ExecuteReaderObject(CommandBehavior behavior, String method, Boolean needReader) at System.Data.Odbc.OdbcCommand.ExecuteReader(CommandBehavior behavior) at DMGForums.Global.Database.Read(String strSql, Int32 Rows) at DMGForums.Setup.SQLSetup.Page_Load(Object sender, EventArgs e)
-------
So now I'm stuck. I tried numerous variations of the connection string thinking maybe that would have some impact. But nothing I tried would fix this problem. Based on the events that happened on my development machine, is it safe to assume that the install is trying to install the forums to some database I don't have access to---even though I specified my database assigned to me by my web host?
I'd really like to use dmgforums, but despite my best efforts looking through these forums and reading posts about install problems and solutions, I can't get this to run on my live webhost.
Can anyone help?
Thanks very much.
|
|
grimmeissen
 Administrator
 Join Date: 8/30/2005 Posts: 656 Location: Cincinnati, Ohio
|
|
|
Posted: 3/2/2009 11:31:39 AM
|
|
|
Okay. It seems to me that the problem is your user account does not have rights to check system tables to determine if the DMG tables already exist. This can be a problem with public-hosted sites and I suppose needs to be addressed in the source.
If you open the DMG Forums source code and look at the file Setup.vb, try removing everything out of the Page_Load subroutine and replacing it with only the following lines.
Code: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) if Not Page.IsPostBack() then InformationPanel.visible = "true" end if End Sub
This removes all checks to see if the database tables exist. If you are sure they do not, you should be given the setup screen if you only use the code above. Make sure you recompile the DMG source after making this change. The important file is Setup.dll.
The username that you are using in web.config must be allowed to create tables for the setup to work. As long as you have that ability, you should be able to run the setup without being able to see system tables, as those are just used to check the existence of the tables before you run setup.
|
|
jp
 Beginner Join Date: 3/2/2009 Posts: 15
|
|
|
Posted: 3/2/2009 2:28:53 PM
|
|
|
Hey... thanks the the response. I'm afraid I've made a terribly idiotic mistake and pasted the wrong error message in. (I was capturing these messages throughout my woes and posted the wrong one.) Please forgive me for the time I cost you in posting your response.
The actual error I'm receiving is this:
ERROR: There was a SQL error during setup. View the error message below and then Click Here to try again.
System.Data.Odbc.OdbcException: ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle) at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions) at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.Odbc.OdbcConnection.Open() at DMGForums.Global.Database.Read(String strSql, Int32 Rows) at DMGForums.Setup.SQLSetup.Page_Load(Object sender, EventArgs e)
If you're up for taking another shot at figuring out what I'm doing wrong, know that I would appreciate it greatly!
Thanks
|
|
grimmeissen
 Administrator
 Join Date: 8/30/2005 Posts: 656 Location: Cincinnati, Ohio
|
|
|
Posted: 3/3/2009 9:08:19 AM
|
|
|
This error message is reporting exactly what it says. It can not find the SQL database listed in your web.config connection string or the username/password you are using does not have access (or isn't correct).
Have you used this database from your host before, or is this something new they set up?
|
|
jp
 Beginner Join Date: 3/2/2009 Posts: 15
|
|
|
Posted: 3/3/2009 2:07:20 PM
|
|
|
Yes, I use the database in my existing web application. All the parameters in the datbasestring key in the web.config are exactly the same parameters I have in my other key in web.config which my application uses.
That's why I was curious about DMG installing in the "master" database within SQL Express on my dev machine. I didn't have any information about that database setup anywhere in my web.config. The forums work fine on the dev machine, but when I didn't see the tables in my database, I just happened to poke around and saw them in "master" database.
So even though my Database String key on the production machine is setup to point to my database, I thought when I received this error message that maybe it was trying to install in some other database it didn't have access to.
I'll post my two web.config database connection strings (one for my app, the other for DMG forums) as a separate reply as soon as I get back to my development machine later today.
Thanks for your continued support on this! I really want to use this product.
|
|
jp
 Beginner Join Date: 3/2/2009 Posts: 15
|
|
|
Posted: 3/3/2009 2:27:20 PM
|
|
|
Here are my two web.config database strings, just so you can see how I have them setup.
This is the one my main web application uses, and it works just fine:
<add key="SQLConnectionString" value="Server=sql2005db-ASP151.asphostserver.com,777;User Id=myuserid;Password=mypassword"/> This is the one I setup for DMG forums which isn't working:
<add key="DatabaseString" value="Driver={SQL Server};defaultDatabase=jaypowers_stl_kreativ;Server=sql2005db-ASP151.asphostserver.com,777;User Id=myuserid;Password=mypassword"/>
|
|
grimmeissen
 Administrator
 Join Date: 8/30/2005 Posts: 656 Location: Cincinnati, Ohio
|
|
|
Posted: 3/4/2009 11:48:44 AM
|
|
|
Try switching your DMG connection string value to the following and let me know what happens.
<add key="DatabaseString" value="Driver={SQL Server};Server=sql2005db-ASP151.asphostserver.com,777;Database=jaypowers_stl_kreativ;Uid=YOUR_USERNAME;Pwd=YOUR_PASSWORD;" />
Your main application is using an ADO data provider, while DMG uses ODBC. The "defaultDatabase" and "User ID" fields are syntactically correct for ADO, but in ODBC you would use "Database" and "Uid".
|
|
jp
 Beginner Join Date: 3/2/2009 Posts: 15
|
|
|
Posted: 3/4/2009 11:58:40 AM
|
|
|
It didn't work, and I received the same error message. (Below)
Any chance it could be something with the server name I'm using in the connect string? I know it's the right name, as it's working with my main web application. But do you think the way DMG forums is attempting to connect it would require a local netbios name, or a server\instance name, or something else?
Thanks for your continued help on this. I'm on a mission now! Please let me know what you'd like me to try next.
ERROR: There was a SQL error during setup. View the error message below and then Click Here to try again.
System.Data.Odbc.OdbcException: ERROR [08001] [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied. ERROR [01000] [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionOpen (Connect()). at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode) at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle) at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions) at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup) at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at System.Data.Odbc.OdbcConnection.Open() at DMGForums.Global.Database.Read(String strSql, Int32 Rows) at DMGForums.Setup.SQLSetup.Page_Load(Object sender, EventArgs e)
|
|
grimmeissen
 Administrator
 Join Date: 8/30/2005 Posts: 656 Location: Cincinnati, Ohio
|
|
|
Posted: 3/4/2009 2:17:40 PM
|
|
|
Unfortunately I don't have much experience with SQL 2005, so I'm not 100% sure. Do you know what the ",777" is for in the server name? This could be causing a problem with ODBC not recognizing the server name as well.
You definitely need to use the string format that I gave you in my last post, but will have to tinker around with server name and the parameters until you get the one that lets you connect.
I'm also not sure if it is similar to SQL Express in that you need an instance name in the server parameter, but I guess not since your string that is working in your main app does not have it.
|
|
empkey2
 Intermediate Join Date: 2/20/2008 Posts: 74
|
|
|
Posted: 3/4/2009 5:02:13 PM
|
|
|
You need to check how to request database schema on MS-Sql2005. The schemes are different among database engines. Please let me know if you still have problem. I will check the statement syntax as I have time.

|
|
jp
 Beginner Join Date: 3/2/2009 Posts: 15
|
|
|
jp
 Beginner Join Date: 3/2/2009 Posts: 15
|
|
|
grimmeissen
 Administrator
 Join Date: 8/30/2005 Posts: 656 Location: Cincinnati, Ohio
|
|
|
Posted: 3/6/2009 2:54:57 PM
|
|
|
Have you contacted your web host and given them the connection string you're trying to use to see if they think it is okay or not?
I'd hate to see you not use DMG because you can't get the database connectivity to work.
At this point the error message isn't giving us much information. DMG hasn't begun to work yet, it's just trying to make a database connection and failing for one reason or another.
|
|
empkey2
 Intermediate Join Date: 2/20/2008 Posts: 74
|
|
|
Posted: 3/6/2009 4:17:28 PM
|
|
|
OK, let's start from beginning to figure out the problem. Are you using ODBC connector to access your database in your existing web application? 1) If NO, the problem may be because of your database schema query. 2) If YES, try using Database object from DMG libraries to run a query statement to your existing database.

|
|
jp
 Beginner Join Date: 3/2/2009 Posts: 15
|
|
|
Posted: 3/6/2009 4:22:07 PM
|
|
|
Here is my connection string for my existing web application:
<add key="SQLConnectionString" value="Server=sql2005db-ASP151.asphostserver.com,777;User Id=myuserid;Password=mypassword"/>
And within the .NET application, I use the SQLClient.
I'm definitely not really proficient at all of this but I'd have to say NO to your question above. Therefore, you're saying that my problem may be because of my database schema query. I have no idea what that is, where it is, etc. A bit of explanation would be helpful.
Thank you all for your continued help!
|
|
empkey2
 Intermediate Join Date: 2/20/2008 Posts: 74
|
|
|