Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 31st, 2004, 07:29 AM
Registered User
 
Join Date: Aug 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Creating a local cube with relational data source

Hi,
I am trying to create a local cube populating data from a relational database like access,sql server or oracle.
In the eg.. mentioned below .. i hve created an MS Access DSN.

When I execute the code i am getting an error which says- Syntax error in column definition...

Incase you have come across this error or have any clues as to why it may be occuring kindly let me know ...

loydon11@rediffmail.com..
Thanks for sparing ur precious time.
######################################Code######## ##################

Private Sub cmdClick_Click()

Dim cnCube As ADODB.Connection
Dim s As String
Dim strProvider As String
Dim strDataSource As String
Dim strSourceDSN As String
Dim strSourceDSNSuffix As String
Dim strCreateCube As String
Dim strInsertInto As String
Dim strSource As String

On Error GoTo Error_cmdCreateCubeFromDatabase_Click

strSource = Connection(1)
strCreateCube = getCreateCube()
strInsertInto = getInsertInto()
Set cnCube = New ADODB.Connection

s = strSource & ";" & strCreateCube & ";" & strInsertInto & ";"

Screen.MousePointer = vbHourglass
cnCube.Open s

Screen.MousePointer = vbDefault
Exit Sub
Error_cmdCreateCubeFromDatabase_Click:
Screen.MousePointer = vbDefault
    MsgBox Err.Description
    If Err.Number <> 0 Then
   msg = "Error # " & Str(Err.Number) & " was generated by " _
         & Err.Source & Chr(13) & Err.Description
   MsgBox msg, , "Error", Err.HelpFile, Err.HelpContext
    End If

End Sub
Private Function Connection(idbtype As Long) As String
'''''''''''''''''''''''''Database Connection to the Cube''''''''''''''''''
strProvider = "PROVIDER=MSOLAP"
strDataSource = "DATA SOURCE=c:\OlapCube.cub"
strSourceDSN = "SOURCE_DSN=AccessLoyd"
Connection = strProvider & ";" & strDataSource & ";" & strSourceDSN
End Function
Private Function getCreateCube() As String

''''''''''''''''''''''''''Create cube Structure'''''''''''''''''''''''''''
Dim strCreateCube As String
strCreateCube = "CREATECUBE=CREATE CUBE cbia( "
strCreateCube = strCreateCube & "DIMENSION[SSTORE],"
strCreateCube = strCreateCube & "LEVEL[SSTORE Name],"
strCreateCube = strCreateCube & "MEASURE [SSTORE Sales] "
strCreateCube = strCreateCube & "Function Sum "
strCreateCube = strCreateCube & "Format '#.#')"
getCreateCube = strCreateCube
End Function
Private Function getInsertInto() As String
'''''''''''''''''''''''''''Insert Clause and Select Clause'''''''''''''''''

Dim strInsertInto As String
'''''''''''''''''''''''''''Table name.Column Name''''''''''''''''''''''''''
strInsertInto = strInsertInto & "INSERTINTO=INSERT INTO cbia( SSTORE.[STORE Name],"
strInsertInto = strInsertInto & "Measures.[STORE Sales])"
strInsertInto = strInsertInto & "SELECT SSTORE.STORE_NAME AS COL1,"
strInsertInto = strInsertInto & "SSTORE.STORE_SALES AS COL2"
strInsertInto = strInsertInto & "FROM [SSTORE]"
getInsertInto = strInsertInto
End Function


Loydon Desa
 
Old August 31st, 2004, 12:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

http://p2p.wrox.com/topic.asp?TOPIC_ID=18431





Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble sorting relational data arcuza Classic ASP Databases 0 May 11th, 2005 03:08 AM
CH. 4 Creating Local Variables mcauliff BOOK: Beginning ASP 3.0 1 March 3rd, 2005 03:57 PM
Creating a local cube with relational data source loydon SQL Server 2000 1 August 31st, 2004 12:16 PM
Creating a local cube with relational data source loydon Access 0 August 31st, 2004 07:27 AM
display data from cube in ASP pkgal79 Classic ASP Databases 0 August 22nd, 2003 02:54 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.