1

Topic: excel+vba insert to ms sql - the coding of Russian letters

Set cnAssets = New ADODB.Connection
strConn = "PROVIDER=SQLOLEDB;"
strConn = strConn AND "DATA SOURCE = **************"
strConn = strConn AND "INTEGRATED SECURITY=sspi;"
cnAssets. Open strConn
sql_insert = sql_insert AND "VALUES ((select N '" AND LCase (Cells (i, v_col_access_groups).Value) AND "'),"...

I write  to a DB. Given not binding variables, and a constant at line
Russian letters reach questions
Explicitly something I do not know in MS SQL (yes practically anything)

2

Re: excel+vba insert to ms sql - the coding of Russian letters

Field type in  what?
collation fields what?
If N to remove before a literal?

3

Re: excel+vba insert to ms sql - the coding of Russian letters

Shocker. Pro;
N ' interposed for  into studios
When in  removed, exchanged nothing
manually did not write, for  in
Script [spoiler]

USE [Assets]
GO
/ ****** Object: Table [dbo]. [scsm_access_groups] Script Date: 11/25/2016 2:03:42 AM PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo]. [scsm_access_groups] (
[group_id] [int] IDENTITY (1,1) NOT NULL;
[access_group] [varchar] (200) NOT NULL;
[company_id] [int] NOT NULL;
[description] [nvarchar] (200) NULL;
[GlobalInfSecurity] [int] NOT NULL;
[LocalInfSecurity] [int] NOT NULL;
[it_service] [varchar] (200) NULL;
[created_user] [varchar] (200) NULL;
[created_date] [date] NULL;
[change_user] [varchar] (200) NULL;
[change_date] [date] NULL;
[date_from] [date] NULL;
[date_to] [date] NULL;
CONSTRAINT [pk_access_groups] UNIQUE NONCLUSTERED
(
[group_id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY];
CONSTRAINT [uk_access_groups] UNIQUE NONCLUSTERED
(
[access_group] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
ALTER TABLE [dbo]. [scsm_access_groups] WITH CHECK ADD CONSTRAINT [fk_scsm_access_groups_company] FOREIGN KEY ([company_id])
REFERENCES [dbo]. [scsm_company] ([company_id])
ON DELETE CASCADE
GO
ALTER TABLE [dbo]. [scsm_access_groups] CHECK CONSTRAINT [fk_scsm_access_groups_company]
GO
ALTER TABLE [dbo]. [scsm_access_groups] WITH CHECK ADD CHECK (([GlobalInfSecurity] = (1) OR [GlobalInfSecurity] = (0)))
GO
ALTER TABLE [dbo]. [scsm_access_groups] WITH CHECK ADD CHECK (([LocalInfSecurity] = (1) OR [LocalInfSecurity] = (0)))
GO

[/spoiler]

4

Re: excel+vba insert to ms sql - the coding of Russian letters

Well that is
You try to interpose  ( N '  ') in  a field (varchar)
In the table  not Cyrillic field, and you try to tire out there cyrillic
Total signs on a question instead of Russian

5

Re: excel+vba insert to ms sql - the coding of Russian letters

Shocker. Pro wrote:

well that is
You try to interpose  ( N '  ') in  a field (varchar)
In the table  not Cyrillic field, and you try to tire out there cyrillic
Total signs on a question instead of Russian

yes, thanks, indeed