Wednesday, September 18, 2013

Geomedia Professional 6.1 , Unable to fetch current record from the cursor error.

In Geomedia Pro 6.1, when you try to insert new record to a spatial database, the error as follows uccured.















I found out this error was caused by the database column (MSSQL Database) type. When the Data type used is nvarchar(MAX), this error occured. See below.




Now, when I change the Data type to nvarchar(100), error gone. Please see below.



Hope this helps you. Cheers.













Thursday, November 12, 2009

How to downgrade / export data / structure from SQL 2005 to SQL 2000

Step 1 Generating Scripts for the Database Elements and Structures

1) Right-click over the desired Database at 2005, Choose Tasks and the Generate Scripts (Option).

2) At the pop-up Dialog Box click at the Script All Objects in the selected Databases check box, to activate it and then Click the Next Button.

3) Set the following Elements to the following Values

a. Script Collation , set to TRUE

b. Script Database Create, set to TRUE

c. Script of SQL Version, set to SQL SERVER 2000

d. Script foreign keys, set to FALSE

e. Script Triggers, set to FALSE

Then Hit the Next button

4) Select the way the generated scripts should be saved (There are different selections. The most common one is Clipboard). Finally click the Next button till you reach the end.

5) Click Finish

After completing this procedure, we have to move to the SQL SERVER 2000 environment. Here, by using the Query Analyzer, we will have to run the scripts that were generated using the master database. Copy and Paste the script at the Query Analyzer and run it. After that the Structure of the Database will be created.

Be careful, the SQL Server 2005 Edition inserts the Views in a random place through the script. Therefore, all the scripts that are referred to the Views MUST be moved to the end of the script. If the Query Analyzer shows some errors do not be bothered. Delete all the elements created from the script and after you fix the code run it again.



Step2 Moving the data from 2005 to 2000

1) After completing the previous step successfully, moving the data follows. Right-click at the 2005 database you used to run the previous step and select Tasks and then choose the Export Data (option).

2) From the pop-up Dialog Box, select the Source Db and Click at the Next Button.

3) At the next step you will have to choose the destination server and the destination Database for the Data to be exported. Then Click Next.

4) A List of all the Source Database’s Elements will appear in the screen. Select one by one all the Elements you wish to move and for each one click at the button Edit Mappings (Located at the bottom right corner of the Dialog Box just under the Elements list). A new Dialog box will pop-up. Select the Delete rows in Destination Tables option and activate the Enable Identity Insert Option. (Remember to repeat this action for each of the selected Element from the list that will be moved.

CAUTION!!! A malfunction of the SQL Server 2005 has been found. Not sure why, after multiple tries I have observed that when I tried to move more than twelve Elements at once, the Export Data Wizard of SQL Server 2005 seemed to disable the Enable Identity Insert Option that was activated over the Edit Mappings Dialog Box. But if the number of the selected Elements is smaller than 12 no problem seemed to appear.


Step 3 Generating Scripts for the Database Foreign Keys and Triggers

Finally, to successfully finish the downgrade of the Database, the Triggers and the Foreign Keys of the DB must be produced. The procedure that should be followed is the one stated next:

1) Right-Click at the SQL 2005 Database and Select from Tasks Menu the Generate Scripts Option.

2) Using the pop-up Dialog Box make sure that the check box Script All Objects in the selected Databases is not enabled and hit the Next Button.

3) Set all the Elements on the List to a False Value except the ones that follow:

a. Include IF NOT EXISTS , set to TRUE

b. Script Owner, set to TRUE

c. Script of SQL Version, set to SQL SERVER 2000

d. Script foreign keys, set to TRUE

e. Script Triggers, set to TRUE

Then Hit the Next button

4) After finishing reading the Elements of the Database, a new list will appear at the Dialog Box. Make sure that you select ONLY THE TABLES of the Database and hit the Next Button.

5) At the screen that follows hit the Select All button and the Next.

6) Select the way the generated scripts should be saved (There are different selections. The most common one is Clipboard). Finally click the Next button till you reach the end.

7) Click Finish Button.

After completing this procedure, we have to move to the SQL SERVER 2000 environment. Here, by using the Query Analyzer, we will have to run the scripts that were generated using the master database. Copy and Paste the script at the Query Analyzer and run it. After that the Foreign Keys and the Triggers of the Database will be created.

After these steps the database should be fully functional under the SQL Server 2000 edition.




Got this from ' http://social.msdn.microsoft.com/forums/en-US/sqldatabaseengine/thread/46e3ecf9-6eab-4aa0-9453-11e7269efb6e/ ' . Thought I should share it to everyone. It works for me. :) .

Thursday, September 11, 2008

Cannot download mdb file in 2.0 - works in 1.1

Microsoft meant this to be a security feature so that IIS wouldnt hand out mdbs to anyone who knew/guessed the proper path/url. To disable this feature and re-allow mdbs to be served, log into the IIS Manager of the Webserver and do the following:
On the treeview, Right Click on the target website folder -> Properties
Under the "Directory" or "Virtual Directory" tab, go to "Configuration" Under the "App Mappings" tab, scroll down and find the ".mdb" extension in the list.
Click Remove. Apply and exit. Then go to Start -> Run -> cmd OR bring up the command prompt somehow, and type in "iisreset /restart" OR restart iis from the management console.
After IIS has been restarted, voila! Your website will now serve mdbs.

Ref: http://forums.asp.net/p/1022569/1393806.aspx

Tuesday, August 19, 2008

Friday, August 1, 2008

dotnet error solution

http://dotnet-error-solution.blogspot.com I put all the error and bug I encounter in developing dot net projects together with the solutions here.I also can help if you have DotNet programming problem.

Monday, July 28, 2008

Event ID: 17052 ,The log file for database 'tempdb' is full.Back up the transaction log for the database to free up some log space

Usually, tempdb (database name) fills up when you are low on disk space, or when you have set an unreasonably low maximum size for database growth.


Solution:
1.Open to create new query. type this 'ALTER DATABASE tempdb SET RECOVERY SIMPLE' with tempdb your database name. Then click execute (!)









2. Then right click on you database, choose Tasks>Shrink>Files
















3. Then, on 'File Type:', select 'Log''.







4. Then, on 'shrink action', choose 'Reorganize pages before releasing unused space'. Shrink file to 1MB(depends on you). Then click ok. Now the log should be shrunk.

ERROR: Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount

Two Datagrid refering to one OnPageIndexChanged Sub. Example. Datagrid A has 1 page only. Datagrid B has 2 page. When try to go to page B's 2nd page, error occur. Because the OnPageIndexChanged Sub will call Datagrid A's 2nd page which does't exist.

Solution:
Create two different OnPageIndexChanged Sub. Make sure the name are different. Example code:

The Datagrid
< id="Datagrid1" runat="server">
AllowPaging="True" AutoGenerateColumns="False"
OnPageIndexChanged="NewPageClick" PageSize="10">

The Sub
Sub NewPageClick(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs) Datagrid1.CurrentPageIndex = e.NewPageIndex
End Sub
.