Showing posts with label vs2005. Show all posts
Showing posts with label vs2005. Show all posts

Tuesday, March 27, 2012

Access Database Datatypes, ADOX and VS2005 Question

I'm using ADOX 2.8 for table creation: The following is an example of a column defintion:

If CreateNewTable Then CreateNewTable = a.CreateColumn("ReferenceCount", ADOX.DataTypeEnum.adInteger)

If CreateNewTable Then CreateNewTable = a.CreateColumn("Document", ADOX.DataTypeEnum.adLongVarBinary) 'Oleobject

If CreateNewTable Then CreateNewTable = a.CreateColumn("EntityID", ADOX.DataTypeEnum.adWChar, 18) 'text

Where CreateColumn looks like this:

Public Function CreateColumn(ByVal ColumnName As String, ByVal Datatype As ADOX.DataTypeEnum, Optional ByVal Size As Integer = 0) As Boolean

'ADOX.CreateColumn- Called by Common.CreateNewTable

'CreateColumn creates a column described in the Table object so it assumes it is set.

'One method of setting it is to call Select Table after opening the database

If Not Me.ConnectionIsOpen Then

MsgBox("CreateColumn - Failed to Create Column : " _

& ColumnName, MsgBoxStyle.Exclamation, cNoConn)

Return False

End If

Dim col As New ADOX.Column

col.Name = ColumnName

Try

col.Type = Datatype

Catch e As Exception

MsgBox("CreateColumb - Failed to Create Column : " _

& ColumnName, MsgBoxStyle.Exclamation, e.Message)

col = Nothing

Return False

End Try

If Size <> 0 Then col.DefinedSize = Size

Try

Table.Columns.Append(ColumnName, Datatype)

Catch e As Exception

If Err.Number() <> 0 Then

MsgBox(Err.Source & "-->" & Err.Description, , "Error")

End If

MsgBox("CreateColumb - Failed to Append Column : " _

& ColumnName, MsgBoxStyle.Exclamation, e.Message)

Return False

End Try

col = Nothing

Return True

End Function

in CreateColumn("EntityID", ADOX.DataTypeEnum.adWChar, 18)

the 18 specifies the field width in the database. Yet no matter whether I use adWChar or

adVarWChar, Access always shows the field size to be 255.

Does anyone know why or how to fix that?

I can see that you created col variable, and assigned values to the fields of it. But, unless I'm missing something, I do not see how it is used in Table.Columns.Append call.

I guess that you should either use col instead of ColumnName, or add Size as a third parameter, and do not use col at all.

Sunday, March 25, 2012

Access BIDS from VS2005

Can SOmeone help me How to get access BIDS from VS2005 . SQL server is installed in different server other than VS 2005 PCYou need to install the SSIS client tools.

Monday, March 19, 2012

Access .Rdl from Asp.net webforms

Hi,

I am new to Sqlserver reporting.I have created few reports using vs2005 busineess intelligence projects and report designer-wizards.

I want to add/access those reports from webforms?is it possible?or do i need to deploy reports over report server.If i run the server i am able to see the report.

If i want to access from .aspx page what do i need to do?I tried adding existing item,.rdl but i do see only .xml part of .rdl .

Can anyone help me on this.

Thanks,

kar1978

Use ReportViewer control

It can be used with

// Set the processing mode for the ReportViewer to Remote

reportViewer.ProcessingMode =ProcessingMode.Remote;

or

reportViewer.ProcessingMode =ProcessingMode.Local