If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Syntax error in column definition ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-19-04, 01:55
loydon@dbforums loydon@dbforums is offline
Registered User
 
Join Date: Jul 2004
Posts: 24
Syntax error in column definition ?

I am trying to create a local olap cube ,populating data from access database.

On executing the code , I am getting an error, syntax error in column definition.

Could you pls tell me why this error is occuring. I have checked the column names in the database as well as the code.. They r the same..

Now , is there any other point I must look on.

Thanks in advance

Loydon
/////////////////////////////

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

On Error GoTo Error_cmdCreateCubeFromDatabase_Click


strProvider = "PROVIDER=MSOLAP"

strDataSource = "DATA SOURCE=c:\OlapCube.cub"

strSourceDSN = "SOURCE_DSN=CubeAccess1"


strCreateCube = "CREATECUBE=CREATE CUBE cbia( "
strCreateCube = strCreateCube & "DIMENSION[STORE],"
strCreateCube = strCreateCube & "LEVEL[STORE Name],"
strCreateCube = strCreateCube & "MEASURE [STORE Sales] "
strCreateCube = strCreateCube & "Function Sum "
strCreateCube = strCreateCube & "Format '#.#')"

strInsertInto = strInsertInto & "INSERTINTO=INSERT INTO cbia( SSTORE.[STORE Name],"
strInsertInto = strInsertInto & "Measures.[STORE Sales])"

''''''''''''''''''''''''Table.Column Name''''''''''''''''''''''''
strInsertInto = strInsertInto & "SELECT SSTORE.STORE_NAME AS COL1 ,"
strInsertInto = strInsertInto & "SSTORE.STORE_SALES AS COL2"
strInsertInto = strInsertInto & "FROM [SSTORE]"

MsgBox strDataSource & "; "
MsgBox strSourceDSN & "; "
MsgBox strCreateCube & "; "
MsgBox strInsertInto & ";"

Set cnCube = New ADODB.Connection
s = strProvider & ";" & strDataSource & ";" & strSourceDSN & ";" & 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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On